From 7e783386dfaf80a0f12d8af4e0df6aeff6043f96 Mon Sep 17 00:00:00 2001 From: amontenegro Date: Thu, 14 Sep 2023 14:15:45 -0600 Subject: [PATCH] If the sent date is null, we should not care about webhook creation date vs profile last modified --- .../java/org/orcid/persistence/jpa/entities/WebhookEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/WebhookEntity.java b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/WebhookEntity.java index 76a99c9906e..a834ea9ed1a 100644 --- a/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/WebhookEntity.java +++ b/orcid-persistence/src/main/java/org/orcid/persistence/jpa/entities/WebhookEntity.java @@ -47,7 +47,7 @@ public class WebhookEntity extends BaseEntity { + "JOIN client_details c ON c.client_details_id = w.client_details_id AND c.deactivated_date is null AND c.webhooks_enabled = 'true'" + " WHERE w.enabled = 'true' " + " AND w.failed_attempt_count < :maxAttemptCount " - + " AND (w.profile_last_modified >= w.last_sent OR (w.last_sent IS NULL AND w.profile_last_modified >= w.date_created))" + + " AND (w.last_sent IS NULL OR w.profile_last_modified >= w.last_sent)" + " AND (w.failed_attempt_count = 0 OR (unix_timestamp(w.last_failed) + w.failed_attempt_count * :retryDelayMinutes * 60) < unix_timestamp(now()))"; @Override