Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(backend): 修复 bk_instance_ids 为 None 的情况 #8596 #8597

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions dbm-ui/backend/flow/utils/cc_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,9 @@ def trigger_operate_collector(
"""
触发操作采集器
"""
if not bk_instance_ids:
return

# 排除掉 bk_instance_ids 中包含 0 的值,可能是脏数据
bk_instance_ids = [bk_instance_id for bk_instance_id in bk_instance_ids if bk_instance_id != 0]

Expand All @@ -617,14 +620,13 @@ def trigger_operate_collector(
logger.error(f"trigger_operate_collector trigger_timer: {trigger_time}")
RedisConn.set(trigger_time_key, trigger_time, ex=OPERATE_COLLECTOR_COUNTDOWN)

if bk_instance_ids:
RedisConn.lpush(cache_key, *bk_instance_ids)
operate_collector.apply_async(
kwargs={
"db_type": db_type,
"machine_type": machine_type,
"bk_instance_ids": bk_instance_ids,
"action": action,
},
countdown=OPERATE_COLLECTOR_COUNTDOWN,
)
RedisConn.lpush(cache_key, *bk_instance_ids)
operate_collector.apply_async(
kwargs={
"db_type": db_type,
"machine_type": machine_type,
"bk_instance_ids": bk_instance_ids,
"action": action,
},
countdown=OPERATE_COLLECTOR_COUNTDOWN,
)
Loading