fix(api): hot loading is blocked in development mode

This commit is contained in:
pycook 2024-05-21 13:14:40 +08:00
parent 6bfb34fe2a
commit d49dc8a067
1 changed files with 5 additions and 4 deletions

View File

@ -3,8 +3,8 @@ import os
import secrets
import sys
import threading
from base64 import b64decode, b64encode
from Cryptodome.Protocol.SecretSharing import Shamir
from colorama import Back, Fore, Style, init as colorama_init
from cryptography.hazmat.backends import default_backend
@ -30,6 +30,7 @@ seal_status = True
secrets_encrypt_key = ""
secrets_root_key = ""
def string_to_bytes(value):
if not value:
return ""
@ -78,7 +79,7 @@ class KeyManage:
(len(sys.argv) > 1 and sys.argv[1] in ("run", "cmdb-password-data-migrate"))):
self.backend = backend
threading.Thread(target=self.watch_root_key, args=(app,)).start()
threading.Thread(target=self.watch_root_key, args=(app,), daemon=True).start()
self.trigger = app.config.get("INNER_TRIGGER_TOKEN")
if not self.trigger: