From faf1379094d623b56adcfaf80a266f61a29a3a55 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 10 Sep 2018 03:29:53 +0200 Subject: [PATCH] [enh] always relaunch monitor_apps_lists --- run.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/run.py b/run.py index 9f654e2..fdd0e3f 100644 --- a/run.py +++ b/run.py @@ -26,6 +26,7 @@ from sanic_jinja2 import SanicJinja2 from playhouse.shortcuts import model_to_dict from models import Repo, Job, db, Worker +from schedule import always_relaunch LOGGING_CONFIG_DEFAULTS["loggers"] = { "task": { @@ -130,6 +131,7 @@ async def create_job(app_id, app_list_name, repo, job_command_last_part): }, "jobs") +@always_relaunch(sleep=60 * 5) async def monitor_apps_lists(type="stable"): "parse apps lists every hour or so to detect new apps" @@ -198,9 +200,6 @@ async def monitor_apps_lists(type="stable"): await asyncio.sleep(3) - await asyncio.sleep(5 * 60) - asyncio.ensure_future(monitor_apps_lists()) - async def launch_monthly_job(type): # XXX DRY