Hangfire now dies gracefully when using CTRL+C rather than Stop button in Rider. Implemented one stream method for testing. Regenerated a few migrations due to oversight in index not taking account of library.

This commit is contained in:
Joseph Milazzo 2021-03-15 08:43:43 -05:00
parent 126fb57f4d
commit 9035b6cc4e
17 changed files with 156 additions and 41 deletions

View file

@ -21,7 +21,7 @@ namespace API.Services
private readonly ICleanupService _cleanupService;
private readonly IDirectoryService _directoryService;
public BackgroundJobServer Client => new BackgroundJobServer();
public static BackgroundJobServer Client => new BackgroundJobServer();
// new BackgroundJobServerOptions()
// {
// WorkerCount = 1
@ -39,16 +39,14 @@ namespace API.Services
_backupService = backupService;
_cleanupService = cleanupService;
_directoryService = directoryService;
//Hangfire.RecurringJob.RemoveIfExists();
ScheduleTasks();
//JobStorage.Current.GetMonitoringApi().EnqueuedJobs()
}
public void ScheduleTasks()
{
_logger.LogInformation("Scheduling reoccurring tasks");
string setting = null;
setting = Task.Run(() => _unitOfWork.SettingsRepository.GetSettingAsync(ServerSettingKey.TaskScan)).Result.Value;
if (setting != null)