aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-08-06 12:38:26 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-08-06 12:38:26 +0200
commit6b149be3163cee173bacd53fda52837bd33b4871 (patch)
tree2e1562d5481719baae5dd2e4df65d7b84f884550
parent7a7f259f3c3c3d9eb7e58d1e0f1ee93090582c80 (diff)
downloadnextcloud-server-6b149be3163cee173bacd53fda52837bd33b4871.tar.gz
nextcloud-server-6b149be3163cee173bacd53fda52837bd33b4871.zip
fix(webhook_listeners): Avoid collision between two identical calls at the same second
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 <come.chilliet@nextcloud.com>
-rw-r--r--apps/webhook_listeners/lib/Listener/WebhooksEventListener.php2
1 files changed, 2 insertions, 0 deletions
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)),
]
);
}