summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Singleton <matt@xcolour.net>2017-09-03 14:09:26 -0400
committerMatt Singleton <matt@xcolour.net>2017-09-03 14:09:26 -0400
commitcdf18074bc6f1df4bc2a605f5fc048b9af104a1b (patch)
treed8d4fd37788e4a19923f5456944d2fd1d5882bf1
parent0eaa69b2db5feb4095d09bf75d4123f960619e79 (diff)
run once and exit argument
-rwxr-xr-xunbiased/main.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/unbiased/main.py b/unbiased/main.py
index caf77eb..4ccda24 100755
--- a/unbiased/main.py
+++ b/unbiased/main.py
@@ -51,6 +51,7 @@ def main():
parser.add_argument('webroot', help='location to write html output')
parser.add_argument('-l', '--log-dir', help='location to write detailed logs')
parser.add_argument('-d', '--debug', action='store_true', help='run in debug mode')
+ parser.add_argument('-o', '--oneshot', action='store_true', help='run once and exit')
args = parser.parse_args()
if args.log_dir:
@@ -71,6 +72,8 @@ def main():
runtime = finish - start
sleeptime = crawl_frequency - runtime
logger.info('Crawl complete in {}s. Sleeping for {}s'.format(int(runtime), int(sleeptime)))
+ if args.oneshot:
+ break
if sleeptime > 0:
time.sleep(sleeptime)