Skip to content

Commit 0b8b427

Browse files
Add prod mode to backup routine. (#292)
1 parent 436fffe commit 0b8b427

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
from biothings.web.launcher import main
1010
from tornado.ioloop import IOLoop
1111
from tornado.web import RequestHandler
12+
from tornado.options import define, options
1213

1314
from admin import routine
1415
from utils.indices import setup
1516

17+
define("prod", default=False, help="Run in production mode", type=bool)
18+
1619

1720
def run_routine():
1821
thread = Thread(target=routine, daemon=True)
@@ -30,7 +33,7 @@ def get(self):
3033

3134
logger = logging.getLogger("routine")
3235

33-
if not options.debug:
36+
if not options.debug and options.prod:
3437
crontab("0 0 * * *", func=run_routine, start=True)
3538
logger.info("Crontab configured successfully.")
3639

0 commit comments

Comments
 (0)