clean up scheduled jobs which have been uninstalled

This commit is contained in:
sbwalker 2025-02-18 09:12:26 -05:00
parent 2df05b4afd
commit 5e147afb9f

View File

@ -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();
});