add sync_redis_state before building schedule for update path

This commit is contained in:
simon 2021-12-16 21:22:05 +07:00
parent 23f9894154
commit ae082eb309
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -8,6 +8,7 @@ Functionality:
import os import os
import home.apps as startup_apps
from celery import Celery, shared_task from celery import Celery, shared_task
from home.src.config import AppConfig, ScheduleBuilder from home.src.config import AppConfig, ScheduleBuilder
from home.src.download import ( from home.src.download import (
@ -313,4 +314,9 @@ def index_channel_playlists(channel_id):
return 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()