From 6b149be3163cee173bacd53fda52837bd33b4871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 6 Aug 2024 12:38:26 +0200 Subject: [PATCH] fix(webhook_listeners): Avoid collision between two identical calls at the same second MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The job list needs argument to be unique for each registered job, so add a random string on top of time to make sure the same call can be registered several times at the same second. Signed-off-by: Côme Chilliet --- apps/webhook_listeners/lib/Listener/WebhooksEventListener.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/webhook_listeners/lib/Listener/WebhooksEventListener.php b/apps/webhook_listeners/lib/Listener/WebhooksEventListener.php index d0b347baed7..6b40af1463e 100644 --- a/apps/webhook_listeners/lib/Listener/WebhooksEventListener.php +++ b/apps/webhook_listeners/lib/Listener/WebhooksEventListener.php @@ -50,6 +50,8 @@ class WebhooksEventListener implements IEventListener { [ $data, $webhookListener->getId(), + /* Random string to avoid collision with another job with the same parameters */ + bin2hex(random_bytes(5)), ] ); }