diff --git a/src/index.py b/src/index.py index ed588382..3ad41bfa 100644 --- a/src/index.py +++ b/src/index.py @@ -9,10 +9,13 @@ from biothings.web.launcher import main from tornado.ioloop import IOLoop from tornado.web import RequestHandler +from tornado.options import define, options from admin import routine from utils.indices import setup +define("prod", default=False, help="Run in production mode", type=bool) + def run_routine(): thread = Thread(target=routine, daemon=True) @@ -30,7 +33,7 @@ def get(self): logger = logging.getLogger("routine") - if not options.debug: + if not options.debug and options.prod: crontab("0 0 * * *", func=run_routine, start=True) logger.info("Crontab configured successfully.")