fix(api): date trigger

This commit is contained in:
pycook 2024-12-23 16:32:27 +08:00
parent 747475b6a6
commit aaa4ca1327
1 changed files with 6 additions and 0 deletions

View File

@ -228,6 +228,12 @@ def cmdb_trigger():
"""
from api.lib.cmdb.ci import CITriggerManager
current_app.test_request_context().push()
if not UserCache.get('worker'):
from api.lib.perm.acl.user import UserCRUD
UserCRUD.add(username='worker', password=uuid.uuid4().hex, email='worker@xxx.com')
login_user(UserCache.get('worker'))
current_day = datetime.datetime.today().strftime("%Y-%m-%d")
trigger2cis = dict()
trigger2completed = dict()