]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(webhook_listeners): Avoid collision between two identical calls at the same second 47061/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 6 Aug 2024 10:38:26 +0000 (12:38 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 6 Aug 2024 10:38:26 +0000 (12:38 +0200)
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>
apps/webhook_listeners/lib/Listener/WebhooksEventListener.php

index d0b347baed7fb834c38c62821c1f819a5bfcca13..6b40af1463ec585c263411ae717f2cc79fd9805e 100644 (file)
@@ -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)),
                                        ]
                                );
                        }