history: set maximum jobs stored to 10000

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2021-03-22 11:45:15 -04:00
parent 4b13af4d86
commit e7f605327f
1 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import logging
import time
HIST_NAMESPACE = "history"
MAX_JOBS = 10000
class History:
def __init__(self, config):
@ -161,6 +162,8 @@ class History:
ps['state'] != "paused"
def add_job(self, job):
if len(self.cached_job_ids) >= MAX_JOBS:
self.delete_job(self.cached_job_ids[0])
job_id = f"{self.next_job_id:06X}"
self.current_job = job
self.current_job_id = job_id