history: set maximum jobs stored to 10000
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
4b13af4d86
commit
e7f605327f
|
@ -5,6 +5,7 @@ import logging
|
||||||
import time
|
import time
|
||||||
|
|
||||||
HIST_NAMESPACE = "history"
|
HIST_NAMESPACE = "history"
|
||||||
|
MAX_JOBS = 10000
|
||||||
|
|
||||||
class History:
|
class History:
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
|
@ -161,6 +162,8 @@ class History:
|
||||||
ps['state'] != "paused"
|
ps['state'] != "paused"
|
||||||
|
|
||||||
def add_job(self, job):
|
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}"
|
job_id = f"{self.next_job_id:06X}"
|
||||||
self.current_job = job
|
self.current_job = job
|
||||||
self.current_job_id = job_id
|
self.current_job_id = job_id
|
||||||
|
|
Loading…
Reference in New Issue