From ae082eb309548d7e15c3d102c7d4d6963b57db31 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 16 Dec 2021 21:22:05 +0700 Subject: [PATCH] add sync_redis_state before building schedule for update path --- tubearchivist/home/tasks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/tasks.py b/tubearchivist/home/tasks.py index a8a2743..bc8d779 100644 --- a/tubearchivist/home/tasks.py +++ b/tubearchivist/home/tasks.py @@ -8,6 +8,7 @@ Functionality: import os +import home.apps as startup_apps from celery import Celery, shared_task from home.src.config import AppConfig, ScheduleBuilder from home.src.download import ( @@ -313,4 +314,9 @@ def index_channel_playlists(channel_id): return -app.conf.beat_schedule = ScheduleBuilder().build_schedule() +try: + app.conf.beat_schedule = ScheduleBuilder().build_schedule() +except KeyError: + # update path from v0.0.8 to v0.0.9 to load new defaults + startup_apps.sync_redis_state() + app.conf.beat_schedule = ScheduleBuilder().build_schedule()