mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
hotfix to release leftover locks on restart
This commit is contained in:
parent
9528e11ca2
commit
f22e02d2f1
@ -3,7 +3,7 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from home.src.config import AppConfig
|
from home.src.config import AppConfig
|
||||||
from home.src.helper import set_message
|
from home.src.helper import del_message, set_message
|
||||||
from home.src.index_management import index_check
|
from home.src.index_management import index_check
|
||||||
|
|
||||||
from .tasks import app as celery_app
|
from .tasks import app as celery_app
|
||||||
@ -36,7 +36,16 @@ def make_folders():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
|
def release_lock():
|
||||||
|
"""make sure there are no leftover locks set in redis on container start"""
|
||||||
|
all_locks = ["manual_import", "downloading"]
|
||||||
|
for lock in all_locks:
|
||||||
|
print("release leftover lock: " + lock)
|
||||||
|
del_message(lock)
|
||||||
|
|
||||||
|
|
||||||
__all__ = ("celery_app",)
|
__all__ = ("celery_app",)
|
||||||
make_folders()
|
make_folders()
|
||||||
sync_redis_state()
|
sync_redis_state()
|
||||||
index_check()
|
index_check()
|
||||||
|
release_lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user