Lots of object and job related tweaks.

This commit is contained in:
Michael Woods
2025-12-28 15:36:58 -05:00
parent 04d34fdf32
commit 55b0e1806b
9 changed files with 63 additions and 16 deletions

View File

@@ -50,6 +50,7 @@ class Server:
self.check_job_queue = True
self.last_check_job_queue = datetime.datetime.now(datetime.UTC)
self.job_check_interval = 60
self.default_job_check_interval = 60
self.quick_job = False
if data_dir:
data_path = Path(data_dir)
@@ -131,10 +132,11 @@ class Server:
self.last_check_job_queue = datetime.datetime.now(datetime.UTC)
if self.quick_job:
logging.debug("Setting the final quick job timer.")
self.job_check_interval = 5
if self.default_job_check_interval > 5:
self.job_check_interval = 5
self.quick_job = False
else:
self.job_check_interval = 60
self.job_check_interval = self.default_job_check_interval
def server_connection_bouncer(self, conn: PacketServerConnection):
logging.debug("new connection bouncer checking user status")
@@ -235,7 +237,9 @@ class Server:
with self.db.transaction() as storage:
if 'job_check_interval' in storage.root.config:
try:
self.job_check_interval = int(storage.root.config['job_check_interval'])
self.default_job_check_interval = int(storage.root.config['job_check_interval'])
if self.job_check_interval > self.default_job_check_interval:
self.job_check_interval = self.default_job_check_interval
except:
logging.warning(f"Invalid config value for 'job_check_interval'")
# queue as many jobs as possible