Commit 36892889 authored by Lukáš Lalinský's avatar Lukáš Lalinský

Fix cron function names

parent b91e3bcd
Pipeline #20433 passed with stages
in 3 minutes and 2 seconds
......@@ -5,11 +5,11 @@ 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
from acoustid.scripts.update_user_agent_stats import main as update_user_agent_stats_main
from acoustid.scripts.cleanup_perf_stats import main as cleanup_perf_stats_main
from acoustid.scripts.merge_missing_mbids import main as merge_missing_mbids_main
from acoustid.scripts.update_stats import run_update_stats
from acoustid.scripts.update_lookup_stats import run_update_lookup_stats
from acoustid.scripts.update_user_agent_stats import run_update_user_agent_stats
from acoustid.scripts.cleanup_perf_stats import run_cleanup_perf_stats
from acoustid.scripts.merge_missing_mbids import run_merge_missing_mbids
logger = logging.getLogger(__name__)
......@@ -25,12 +25,12 @@ def create_schedule(script):
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(run_merge_missing_mbids))
schedule.every(55).to(65).minutes.do(wrap_job(run_update_lookup_stats))
# 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(run_update_stats))
schedule.every(23).to(25).hours.do(wrap_job(run_update_user_agent_stats))
schedule.every(23).to(25).hours.do(wrap_job(run_cleanup_perf_stats))
return schedule
......
......@@ -4,7 +4,7 @@
import datetime
def main(script, opts, args):
def run_cleanup_perf_stats(script, opts, args):
two_days_ago = datetime.datetime.now() - datetime.timedelta(days=2)
last_key = two_days_ago.strftime('%Y-%m-%d:%H:%M')
redis = script.redis
......
......@@ -9,7 +9,7 @@ from acoustid.data.track import merge_missing_mbids
logger = logging.getLogger(__name__)
def main(script, opts, args):
def run_merge_missing_mbids(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running merge_missing_mbids in slave mode')
return
......
......@@ -6,7 +6,7 @@ from acoustid.utils import call_internal_api
from acoustid.data.stats import update_lookup_stats
def main(script, opts, args):
def run_update_lookup_stats(script, opts, args):
db = script.engine.connect()
redis = script.redis
for key, count in redis.hgetall('lookups').iteritems():
......
......@@ -56,7 +56,7 @@ def get_track_count_stats(db, query):
return sorted(counts.items())
def main(script, opts, args):
def run_update_stats(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running update_stats in slave mode')
return
......
......@@ -5,7 +5,7 @@ from acoustid.utils import call_internal_api
from acoustid.data.stats import update_user_agent_stats, unpack_user_agent_stats_key
def main(script, opts, args):
def run_update_user_agent_stats(script, opts, args):
db = script.engine.connect()
redis = script.redis
for key, count in redis.hgetall('ua').iteritems():
......
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