mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 08:16: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)
|
public async Task NotifyAsync(NotificationOptions model)
|
||||||
{
|
{
|
||||||
|
Settings.ClearCache();
|
||||||
var configuration = await GetConfiguration();
|
var configuration = await GetConfiguration();
|
||||||
await NotifyAsync(model, configuration);
|
await NotifyAsync(model, configuration);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,10 +31,8 @@ namespace Ombi.Schedule.Jobs.SickRage
|
||||||
private readonly ILogger<SickRageSync> _log;
|
private readonly ILogger<SickRageSync> _log;
|
||||||
private readonly IOmbiContext _ctx;
|
private readonly IOmbiContext _ctx;
|
||||||
|
|
||||||
private static readonly SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1);
|
|
||||||
public async Task Start()
|
public async Task Start()
|
||||||
{
|
{
|
||||||
await SemaphoreSlim.WaitAsync();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var settings = await _settings.GetSettingsAsync();
|
var settings = await _settings.GetSettingsAsync();
|
||||||
|
@ -42,6 +40,7 @@ namespace Ombi.Schedule.Jobs.SickRage
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var shows = await _api.GetShows(settings.ApiKey, settings.FullUri);
|
var shows = await _api.GetShows(settings.ApiKey, settings.FullUri);
|
||||||
if (shows != null)
|
if (shows != null)
|
||||||
{
|
{
|
||||||
|
@ -83,10 +82,6 @@ namespace Ombi.Schedule.Jobs.SickRage
|
||||||
{
|
{
|
||||||
_log.LogError(LoggingEvents.SickRageCacher, e, "Exception when trying to cache SickRage");
|
_log.LogError(LoggingEvents.SickRageCacher, e, "Exception when trying to cache SickRage");
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
SemaphoreSlim.Release();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _disposed;
|
private bool _disposed;
|
||||||
|
|
|
@ -31,10 +31,8 @@ namespace Ombi.Schedule.Jobs.Sonarr
|
||||||
private readonly ILogger<SonarrSync> _log;
|
private readonly ILogger<SonarrSync> _log;
|
||||||
private readonly IOmbiContext _ctx;
|
private readonly IOmbiContext _ctx;
|
||||||
|
|
||||||
private static readonly SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1);
|
|
||||||
public async Task Start()
|
public async Task Start()
|
||||||
{
|
{
|
||||||
await SemaphoreSlim.WaitAsync();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var settings = await _settings.GetSettingsAsync();
|
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");
|
_log.LogError(LoggingEvents.SonarrCacher, e, "Exception when trying to cache Sonarr");
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
SemaphoreSlim.Release();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _disposed;
|
private bool _disposed;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue