Merge pull request #5109 from sbwalker/dev
clean up scheduled jobs which have been uninstalled
This commit is contained in:
commit
46bcad1fca
|
@ -22,6 +22,14 @@ namespace Oqtane.Repository
|
|||
{
|
||||
return _cache.GetOrCreate("jobs", entry =>
|
||||
{
|
||||
// remove any jobs which have been uninstalled
|
||||
foreach (var job in _db.Job.ToList())
|
||||
{
|
||||
if (Type.GetType(job.JobType) == null)
|
||||
{
|
||||
DeleteJob(job.JobId);
|
||||
}
|
||||
}
|
||||
entry.SlidingExpiration = TimeSpan.FromMinutes(30);
|
||||
return _db.Job.ToList();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user