clean up scheduled jobs which have been uninstalled
This commit is contained in:
parent
2df05b4afd
commit
5e147afb9f
|
@ -22,6 +22,14 @@ namespace Oqtane.Repository
|
||||||
{
|
{
|
||||||
return _cache.GetOrCreate("jobs", entry =>
|
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);
|
entry.SlidingExpiration = TimeSpan.FromMinutes(30);
|
||||||
return _db.Job.ToList();
|
return _db.Job.ToList();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user