This commit is contained in:
Mike McLean 2023-05-02 11:41:23 -04:00 committed by Tomas Kopecek
parent 3595229425
commit 58a5e94b20
2 changed files with 11 additions and 1 deletions

View file

@ -136,6 +136,7 @@ class TaskScheduler(object):
# already ran too recently
return False
logger.info('Running task scheduler')
self.get_tasks()
self.get_hosts()
self.check_hosts()
@ -193,7 +194,6 @@ class TaskScheduler(object):
def do_schedule(self):
# debug
logger.info('Running task scheduler')
logger.info(f'Hosts: {len(self.hosts)}')
logger.info(f'Free tasks: {len(self.free_tasks)}')
logger.info(f'Active tasks: {len(self.active_tasks)}')

View file

@ -1027,6 +1027,16 @@ CREATE TABLE scheduler_map (
) WITHOUT OIDS;
CREATE TABLE scheduler_task_refusals (
id SERIAL NOT NULL PRIMARY KEY,
task_id INTEGER REFERENCES task (id) NOT NULL,
host_id INTEGER REFERENCES host (id) NOT NULL,
by_host BOOLEAN NOT NULL,
msg TEXT,
time TIMESTAMPTZ NOT NULL DEFAULT NOW()
) WITHOUT OIDS;
CREATE TABLE scheduler_log_messages (
id SERIAL NOT NULL PRIMARY KEY,
task_id INTEGER REFERENCES task (id),