mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 20:00:15 +00:00
add scheduler config to regular redis config
This commit is contained in:
parent
5cb6076a1c
commit
21f70493bb
@ -163,6 +163,7 @@ class ScheduleBuilder:
|
||||
"thumbnail_check": "0 17 *",
|
||||
"run_backup": "0 18 0",
|
||||
}
|
||||
CONFIG = ["check_reindex_days", "run_backup_rotate"]
|
||||
|
||||
def __init__(self):
|
||||
self.config = AppConfig().config
|
||||
@ -173,9 +174,11 @@ class ScheduleBuilder:
|
||||
redis_config = self.config
|
||||
for key, value in form_post.items():
|
||||
to_check = value[0]
|
||||
if key in self.SCHEDULES.keys() and to_check:
|
||||
if key in self.SCHEDULES and to_check:
|
||||
to_write = self.value_builder(key, to_check)
|
||||
redis_config["scheduler"][key] = to_write
|
||||
if key in self.CONFIG and to_check:
|
||||
redis_config["scheduler"][key] = int(to_check)
|
||||
RedisArchivist().set_message("config", redis_config, expire=False)
|
||||
|
||||
def value_builder(self, key, to_check):
|
||||
|
Loading…
Reference in New Issue
Block a user