fix(api commands): cmdb-password-data-migrate

This commit is contained in:
pycook
2023-11-02 20:40:21 +08:00
parent fe2606176b
commit 2ff06c74c7
2 changed files with 8 additions and 2 deletions

View File

@@ -65,7 +65,8 @@ class KeyManage:
self.backend = Backend(backend)
def init_app(self, app, backend=None):
if sys.argv[0].endswith("gunicorn") or (len(sys.argv) > 1 and sys.argv[1] == "run"):
if (sys.argv[0].endswith("gunicorn") or
(len(sys.argv) > 1 and sys.argv[1] in ("run", "cmdb-password-data-migrate"))):
self.trigger = app.config.get("INNER_TRIGGER_TOKEN")
if not self.trigger:
return