diff --git a/batch/job_scheduler/jobs.py b/batch/job_scheduler/jobs.py index 6faea109..dc2c1f14 100644 --- a/batch/job_scheduler/jobs.py +++ b/batch/job_scheduler/jobs.py @@ -99,26 +99,10 @@ def test_scheduler(): job_runner.run_job() -def load_19_02_skills(): +def load_skills(version): """Load the json file from the mycroft-skills-data repository to the DB""" job_runner = JobRunner('load_skill_display_data.py') - job_runner.job_args = '--core-version 19.02' - job_runner.job_date = date.today() - timedelta(days=1) - job_runner.run_job() - - -def load_19_08_skills(): - """Load the json file from the mycroft-skills-data repository to the DB""" - job_runner = JobRunner('load_skill_display_data.py') - job_runner.job_args = '--core-version 19.08' - job_runner.job_date = date.today() - timedelta(days=1) - job_runner.run_job() - - -def load_20_02_skills(): - """Load the json file from the mycroft-skills-data repository to the DB""" - job_runner = JobRunner('load_skill_display_data.py') - job_runner.job_args = '--core-version 20.02' + job_runner.job_args = '--core-version {}'.format(version) job_runner.job_date = date.today() - timedelta(days=1) job_runner.run_job() @@ -162,9 +146,9 @@ if os.environ['SELENE_ENVIRONMENT'] != 'prod': schedule.every().day.at('00:00').do(partition_api_metrics) schedule.every().day.at('00:05').do(update_device_last_contact) schedule.every().day.at('00:10').do(parse_core_metrics) -schedule.every().day.at('00:15').do(load_19_02_skills) -schedule.every().day.at('00:20').do(load_19_08_skills) -schedule.every().day.at('00:25').do(load_20_02_skills) +schedule.every().day.at('00:15').do(load_skills, version='19.02') +schedule.every().day.at('00:20').do(load_skills, version='19.08') +schedule.every().day.at('00:25').do(load_skills, version='20.02') # Run the schedule while True: