misc: iterate AfterJob one by one when cleaning them (#56191)
This commit is contained in:
parent
1aea2407ce
commit
16a91507d4
|
@ -637,7 +637,8 @@ class QommonPublisher(Publisher):
|
|||
|
||||
def clean_afterjobs(self):
|
||||
now = time.time()
|
||||
for job in AfterJob.select():
|
||||
for job_id in AfterJob.keys():
|
||||
job = AfterJob.get(job_id)
|
||||
if job.status == 'completed' and (now - job.completion_time) > 3600:
|
||||
# completed for more than one hour
|
||||
job.remove_self()
|
||||
|
|
Loading…
Reference in New Issue