mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
More memory management and improvements
This commit is contained in:
parent
835be4385b
commit
96cf4388bc
12 changed files with 128 additions and 7 deletions
|
@ -102,5 +102,25 @@ namespace Ombi.Schedule.Jobs.Couchpotato
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _disposed;
|
||||||
|
protected virtual void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (_disposed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
_settings?.Dispose();
|
||||||
|
_ctx?.Dispose();
|
||||||
|
}
|
||||||
|
_disposed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Dispose(true);
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace Ombi.Schedule.Jobs.Couchpotato
|
namespace Ombi.Schedule.Jobs.Couchpotato
|
||||||
{
|
{
|
||||||
public interface ICouchPotatoSync
|
public interface ICouchPotatoSync : IBaseJob
|
||||||
{
|
{
|
||||||
Task Start();
|
Task Start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ using Hangfire.Server;
|
||||||
|
|
||||||
namespace Ombi.Schedule.Jobs.Ombi
|
namespace Ombi.Schedule.Jobs.Ombi
|
||||||
{
|
{
|
||||||
public interface IOmbiAutomaticUpdater
|
public interface IOmbiAutomaticUpdater : IBaseJob
|
||||||
{
|
{
|
||||||
Task Update(PerformContext context);
|
Task Update(PerformContext context);
|
||||||
string[] GetVersion();
|
string[] GetVersion();
|
||||||
|
|
|
@ -3,7 +3,7 @@ using Ombi.Store.Entities;
|
||||||
|
|
||||||
namespace Ombi.Schedule.Jobs.Ombi
|
namespace Ombi.Schedule.Jobs.Ombi
|
||||||
{
|
{
|
||||||
public interface IWelcomeEmail
|
public interface IWelcomeEmail : IBaseJob
|
||||||
{
|
{
|
||||||
Task SendEmail(OmbiUser user);
|
Task SendEmail(OmbiUser user);
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,5 +315,25 @@ namespace Ombi.Schedule.Jobs.Ombi
|
||||||
await client.DownloadFileTaskAsync(requestUri, filename);
|
await client.DownloadFileTaskAsync(requestUri, filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _disposed;
|
||||||
|
protected virtual void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (_disposed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
_appConfig?.Dispose();
|
||||||
|
Settings?.Dispose();
|
||||||
|
}
|
||||||
|
_disposed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Dispose(true);
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Threading.Tasks;
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using Ombi.Core.Settings;
|
using Ombi.Core.Settings;
|
||||||
using Ombi.Helpers;
|
using Ombi.Helpers;
|
||||||
using Ombi.Notifications;
|
using Ombi.Notifications;
|
||||||
|
@ -62,5 +63,25 @@ namespace Ombi.Schedule.Jobs.Ombi
|
||||||
|
|
||||||
return parsed;
|
return parsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _disposed;
|
||||||
|
protected virtual void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (_disposed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
_emailSettings?.Dispose();
|
||||||
|
_customizationSettings?.Dispose();
|
||||||
|
}
|
||||||
|
_disposed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Dispose(true);
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@ using Ombi.Store.Entities;
|
||||||
|
|
||||||
namespace Ombi.Schedule.Jobs.Radarr
|
namespace Ombi.Schedule.Jobs.Radarr
|
||||||
{
|
{
|
||||||
public interface IRadarrSync
|
public interface IRadarrSync : IBaseJob
|
||||||
{
|
{
|
||||||
Task CacheContent();
|
Task CacheContent();
|
||||||
Task<IEnumerable<RadarrCache>> GetCachedContent();
|
Task<IEnumerable<RadarrCache>> GetCachedContent();
|
||||||
|
|
|
@ -89,5 +89,25 @@ namespace Ombi.Schedule.Jobs.Radarr
|
||||||
{
|
{
|
||||||
return await _ctx.RadarrCache.ToListAsync();
|
return await _ctx.RadarrCache.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _disposed;
|
||||||
|
protected virtual void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (_disposed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
_ctx?.Dispose();
|
||||||
|
RadarrSettings?.Dispose();
|
||||||
|
}
|
||||||
|
_disposed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Dispose(true);
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace Ombi.Schedule.Jobs.SickRage
|
namespace Ombi.Schedule.Jobs.SickRage
|
||||||
{
|
{
|
||||||
public interface ISickRageSync
|
public interface ISickRageSync : IBaseJob
|
||||||
{
|
{
|
||||||
Task Start();
|
Task Start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,5 +88,25 @@ namespace Ombi.Schedule.Jobs.SickRage
|
||||||
SemaphoreSlim.Release();
|
SemaphoreSlim.Release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _disposed;
|
||||||
|
protected virtual void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (_disposed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
_settings?.Dispose();
|
||||||
|
_ctx?.Dispose();
|
||||||
|
}
|
||||||
|
_disposed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Dispose(true);
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace Ombi.Schedule.Jobs.Sonarr
|
namespace Ombi.Schedule.Jobs.Sonarr
|
||||||
{
|
{
|
||||||
public interface ISonarrSync
|
public interface ISonarrSync : IBaseJob
|
||||||
{
|
{
|
||||||
Task Start();
|
Task Start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,5 +84,25 @@ namespace Ombi.Schedule.Jobs.Sonarr
|
||||||
SemaphoreSlim.Release();
|
SemaphoreSlim.Release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _disposed;
|
||||||
|
protected virtual void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (_disposed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (disposing)
|
||||||
|
{
|
||||||
|
_settings?.Dispose();
|
||||||
|
_ctx?.Dispose();
|
||||||
|
}
|
||||||
|
_disposed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Dispose(true);
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue