perf(api): ci delete (#297)

This commit is contained in:
pycook 2023-12-12 11:09:32 +08:00 committed by GitHub
parent cf0ad7bad6
commit c918d54ea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -514,9 +514,9 @@ class CIManager(object):
ci_delete_trigger.apply_async(args=(trigger, OperateType.DELETE, ci_dict), queue=CMDB_QUEUE)
attrs = CITypeAttribute.get_by(type_id=ci.type_id, to_dict=False)
attr_names = set([AttributeCache.get(attr.attr_id).name for attr in attrs])
for attr_name in attr_names:
value_table = TableMap(attr_name=attr_name).table
attrs = [AttributeCache.get(attr.attr_id) for attr in attrs]
for attr in attrs:
value_table = TableMap(attr=attr).table
for item in value_table.get_by(ci_id=ci_id, to_dict=False):
item.delete(commit=False)

View File

@ -68,6 +68,7 @@ ONCE = {
}
# # SSO
AUTH_WITH_CAS = False
CAS_SERVER = "http://sso.xxx.com"
CAS_VALIDATE_SERVER = "http://sso.xxx.com"
CAS_LOGIN_ROUTE = "/cas/built-in/cas/login"

View File

@ -48,9 +48,9 @@ services:
/wait
flask db-setup
flask common-check-new-columns
gunicorn --workers=3 autoapp:app -b 0.0.0.0:5000 -D
gunicorn --workers=8 autoapp:app -b 0.0.0.0:5000 -D
celery -A celery_worker.celery worker -E -Q one_cmdb_async --autoscale=5,2 --logfile=one_cmdb_async.log -D
celery -A celery_worker.celery worker -E -Q one_cmdb_async --autoscale=8,2 --logfile=one_cmdb_async.log -D
celery -A celery_worker.celery worker -E -Q acl_async --logfile=one_acl_async.log --concurrency=2 -D
nohup flask cmdb-trigger > trigger.log 2>&1 &