njnu-seafish commented on code in PR #18549:
URL:
https://github.com/apache/dolphinscheduler/pull/18549#discussion_r4237081219
##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/AlertMapper.java:
##########
@@ -43,6 +43,13 @@ List<Alert> listingAlertByStatus(@Param("minAlertId") int
minAlertId, @Param("al
void insertAlertWhenServerCrash(@Param("alert") Alert alert,
@Param("crashAlarmSuppressionStartTime")
Date crashAlarmSuppressionStartTime);
+ /**
+ * Insert a task-result alert. Idempotency is enforced by the
uk_alert_dedup unique constraint
+ * on (sign, workflow_instance_id, alert_type); the DAO layer catches
DuplicateKeyException
+ * and treats it as a skip.
+ */
+ int insertTaskResultAlert(@Param("alert") Alert alert);
Review Comment:
> Can we directly use insert? what is the difference with insert
Good point — insertTaskResultAlert was just the same columns as
BaseMapper.insert. Removed it; addTaskResultAlert now uses
alertMapper.insert(alert) and still skips duplicates via DuplicateKeyException.
Fixed in 37e4552e0b.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]