Commit 07b9b7e8 authored by Lukáš Lalinský's avatar Lukáš Lalinský

Fix function names in cron

parent 0a3ecef2
Pipeline #20418 passed with stages
in 2 minutes and 41 seconds
......@@ -3,6 +3,7 @@
import time
import logging
import functools
from schedule import Scheduler
from acoustid.scripts.update_stats import main as update_stats_main
from acoustid.scripts.update_lookup_stats import main as update_lookup_stats_main
......@@ -16,17 +17,20 @@ logger = logging.getLogger(__name__)
def create_schedule(script):
def wrap_job(func):
logger.info('Running %s', func.__name__)
func(script, None, None)
@functools.wraps(func)
def wrapper():
logger.info('Running %s', func.__name__)
func(script, None, None)
return wrapper
schedule = Scheduler()
# hourly jobs
schedule.every(55).to(65).minutes.do(wrap_job, merge_missing_mbids_main)
schedule.every(55).to(65).minutes.do(wrap_job, update_lookup_stats_main)
schedule.every(55).to(65).minutes.do(wrap_job(merge_missing_mbids_main))
schedule.every(55).to(65).minutes.do(wrap_job(update_lookup_stats_main))
# daily jobs
schedule.every(23).to(25).hours.do(wrap_job, update_stats_main)
schedule.every(23).to(25).hours.do(wrap_job, update_user_agent_stats_main)
schedule.every(23).to(25).hours.do(wrap_job, cleanup_perf_stats_main)
schedule.every(23).to(25).hours.do(wrap_job(update_stats_main))
schedule.every(23).to(25).hours.do(wrap_job(update_user_agent_stats_main))
schedule.every(23).to(25).hours.do(wrap_job(cleanup_perf_stats_main))
return schedule
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment