Skip to content

Commit

Permalink
fix: 事件收敛逻辑异常 --bug=133902231
Browse files Browse the repository at this point in the history
1. 修复因为收敛比较逻辑写反导致的风险关闭后,新上报的事件不会生成新的风险。事件收敛的逻辑:如果关闭的历史风险关联的事件时间大于等于新上报的事件时间,就不生成新的风险。
  • Loading branch information
0RAJA committed Nov 13, 2024
1 parent 0e092a5 commit 9a2c383
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/services/web/risk/handlers/risk.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def create_risk(self, event: dict) -> (bool, Risk):
& Q(
~Q(status=RiskStatus.CLOSED)
| Q(
event_end_time__lte=datetime.datetime.fromtimestamp(
event_end_time__gte=datetime.datetime.fromtimestamp(
event["event_time"] / 1000, tz=timezone.get_default_timezone()
)
)
Expand Down

0 comments on commit 9a2c383

Please sign in to comment.