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>
pull/47061/head
Côme Chilliet 2024-08-06 12:38:26 +07:00
parent 7a7f259f3c
commit 6b149be316
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
1 changed files with 2 additions and 0 deletions

@ -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)),
]
);
}