mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 15:56:05 -07:00
Removed the potential locking
This commit is contained in:
parent
6e79574aba
commit
96697000b1
3 changed files with 4 additions and 14 deletions
|
@ -42,6 +42,7 @@ namespace Ombi.Notifications.Interfaces
|
|||
|
||||
public async Task NotifyAsync(NotificationOptions model)
|
||||
{
|
||||
Settings.ClearCache();
|
||||
var configuration = await GetConfiguration();
|
||||
await NotifyAsync(model, configuration);
|
||||
}
|
||||
|
|
|
@ -31,10 +31,8 @@ namespace Ombi.Schedule.Jobs.SickRage
|
|||
private readonly ILogger<SickRageSync> _log;
|
||||
private readonly IOmbiContext _ctx;
|
||||
|
||||
private static readonly SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1);
|
||||
public async Task Start()
|
||||
{
|
||||
await SemaphoreSlim.WaitAsync();
|
||||
try
|
||||
{
|
||||
var settings = await _settings.GetSettingsAsync();
|
||||
|
@ -42,6 +40,7 @@ namespace Ombi.Schedule.Jobs.SickRage
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var shows = await _api.GetShows(settings.ApiKey, settings.FullUri);
|
||||
if (shows != null)
|
||||
{
|
||||
|
@ -83,10 +82,6 @@ namespace Ombi.Schedule.Jobs.SickRage
|
|||
{
|
||||
_log.LogError(LoggingEvents.SickRageCacher, e, "Exception when trying to cache SickRage");
|
||||
}
|
||||
finally
|
||||
{
|
||||
SemaphoreSlim.Release();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _disposed;
|
||||
|
|
|
@ -31,10 +31,8 @@ namespace Ombi.Schedule.Jobs.Sonarr
|
|||
private readonly ILogger<SonarrSync> _log;
|
||||
private readonly IOmbiContext _ctx;
|
||||
|
||||
private static readonly SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1);
|
||||
public async Task Start()
|
||||
{
|
||||
await SemaphoreSlim.WaitAsync();
|
||||
try
|
||||
{
|
||||
var settings = await _settings.GetSettingsAsync();
|
||||
|
@ -79,10 +77,6 @@ namespace Ombi.Schedule.Jobs.Sonarr
|
|||
{
|
||||
_log.LogError(LoggingEvents.SonarrCacher, e, "Exception when trying to cache Sonarr");
|
||||
}
|
||||
finally
|
||||
{
|
||||
SemaphoreSlim.Release();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _disposed;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue