handle foreground override in TaskManager
This commit is contained in:
parent
7d9b22a75b
commit
e7bb3ed14b
2 changed files with 1 additions and 6 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue