A couple other tweaks.
This commit is contained in:
@@ -156,6 +156,7 @@ class Orchestrator:
|
||||
self.runners = []
|
||||
self.runner_lock = Lock()
|
||||
self.listeners = []
|
||||
self.started: bool = False
|
||||
|
||||
def get_finished_runners(self) -> list[Runner]:
|
||||
return [r for r in self.runners if r.is_finished()]
|
||||
@@ -195,8 +196,10 @@ class Orchestrator:
|
||||
|
||||
def start(self):
|
||||
"""Do any setup and then be ready to operate"""
|
||||
self.started = True
|
||||
pass
|
||||
|
||||
def stop(self):
|
||||
"""Do any cleanup needed."""
|
||||
self.started = False
|
||||
pass
|
||||
@@ -167,7 +167,6 @@ class PodmanRunner(Runner):
|
||||
class PodmanOrchestrator(Orchestrator):
|
||||
def __init__(self, uri: Optional[str] = None, options: Optional[PodmanOptions] = None):
|
||||
super().__init__()
|
||||
self.started = False
|
||||
self.user_containers = {}
|
||||
self.manager_thread = None
|
||||
self._client = None
|
||||
|
||||
@@ -233,6 +233,11 @@ class Server:
|
||||
self.ping_job_queue()
|
||||
if (self.orchestrator is not None) and self.orchestrator.started and self.check_job_queue:
|
||||
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'])
|
||||
except:
|
||||
logging.warning(f"Invalid config value for 'job_check_interval'")
|
||||
# queue as many jobs as possible
|
||||
while self.orchestrator.runners_available():
|
||||
if len(storage.root.job_queue) > 0:
|
||||
|
||||
Reference in New Issue
Block a user