Merge pull request #210 from MycroftAI/feature/load-skills

Refactor - generalize load_skills for any version of Core
pull/220/head
Chris Veilleux 2020-06-17 14:39:28 -05:00 committed by GitHub
commit 2ca70199ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 21 deletions

View File

@ -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: