handle foreground override in TaskManager

This commit is contained in:
Mike McLean 2025-03-21 23:44:03 -04:00
parent 7d9b22a75b
commit e7bb3ed14b
2 changed files with 1 additions and 6 deletions

View file

@ -145,11 +145,6 @@ def main(options, session):
logger.info('Loading plugin: %s' % name)
tm.scanPlugin(pt.load(name))
if options.single:
# force all task handlers to run in Foreground
for key in tm.handlers:
tm.handlers[key].Foreground = True
def shutdown(*args):
raise SystemExit

View file

@ -1379,7 +1379,7 @@ class TaskManager(object):
return False
# otherwise...
raise
if handler.Foreground:
if handler.Foreground or getattr(self.options, "single"):
self.logger.info("running task in foreground")
handler.setManager(self)
self.runTask(handler)