From 043c6e15fc62aa5b291b1c18fc02e1d07c9700c5 Mon Sep 17 00:00:00 2001 From: Everaldo Date: Tue, 22 Jul 2025 10:04:20 -0700 Subject: [PATCH] Add prod mode to backup routine. --- src/index.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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.")