Update Notification Refactor (#511)

* Replaced profile links to anchors so we can open in new tab if we like

* Refactored how update checking works. We now explicitly check and send back on the same API. We have a weekly job that will push an update to the user.

* Implemented a changelog tab

* Ported over a GA fix for using ' in PR bodies.

* Don't check cert for Github
This commit is contained in:
Joseph Milazzo 2021-08-19 16:49:53 -07:00 committed by GitHub
parent 0e48aeebc5
commit 2a76092566
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 246 additions and 56 deletions

View file

@ -70,6 +70,8 @@ namespace API.Services
}
RecurringJob.AddOrUpdate("cleanup", () => _cleanupService.Cleanup(), Cron.Daily);
RecurringJob.AddOrUpdate("check-for-updates", () => _scannerService.ScanLibraries(), Cron.Daily);
}
#region StatsTasks
@ -104,7 +106,7 @@ namespace API.Services
public void ScheduleUpdaterTasks()
{
_logger.LogInformation("Scheduling Auto-Update tasks");
RecurringJob.AddOrUpdate("check-updates", () => _versionUpdaterService.CheckForUpdate(), Cron.Daily);
RecurringJob.AddOrUpdate("check-updates", () => CheckForUpdate(), Cron.Weekly);
}
#endregion
@ -152,9 +154,13 @@ namespace API.Services
BackgroundJob.Enqueue(() => _backupService.BackupDatabase());
}
public void CheckForUpdate()
/// <summary>
/// Not an external call. Only public so that we can call this for a Task
/// </summary>
public async Task CheckForUpdate()
{
BackgroundJob.Enqueue(() => _versionUpdaterService.CheckForUpdate());
var update = await _versionUpdaterService.CheckForUpdate();
await _versionUpdaterService.PushUpdate(update);
}
}
}