| |
@@ -189,6 +189,9 @@
|
| |
# from getting overloaded.
|
| |
logger.debug('Sleeping for %s', options.sleeptime)
|
| |
time.sleep(options.sleeptime)
|
| |
+ elif options.single:
|
| |
+ # exit after first task
|
| |
+ break
|
| |
except (SystemExit, KeyboardInterrupt):
|
| |
logger.warning("Exiting")
|
| |
break
|
| |
@@ -6741,6 +6744,8 @@
|
| |
parser.add_option("-f", "--fg", dest="daemon",
|
| |
action="store_false", default=True,
|
| |
help="run in foreground")
|
| |
+ parser.add_option("--single", action="store_true",
|
| |
+ help="run a single task in foreground, for debugging")
|
| |
parser.add_option("--force-lock", action="store_true", default=False,
|
| |
help="force lock for exclusive session")
|
| |
parser.add_option("-v", "--verbose", action="store_true", default=False,
|
| |
@@ -6778,6 +6783,10 @@
|
| |
# not reached
|
| |
assert False # pragma: no cover
|
| |
|
| |
+ # --single implies --fg
|
| |
+ if options.single:
|
| |
+ options.daemon = False
|
| |
+
|
| |
# load local config
|
| |
config = koji.read_config_files(options.configFile, raw=True)
|
| |
for x in config.sections():
|
| |
This is an option for debugging kojid. I needed this to debug a build problem and thought it would be useful to keep.
Using this option makes it feasible to use the python debugger on a task handler.