Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.")

Expand Down