Skip to content

Commit ec04660

Browse files
committed
fixup! fix(userstatus): catch unique constraint violation
1 parent d1c861a commit ec04660

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/user_status/lib/Listener/UserLiveStatusListener.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ public function handle(Event $event): void {
117117
$this->mapper->insert($userStatus);
118118
} catch (Exception $e) {
119119
if ($e->getReason() === Exception::REASON_UNIQUE_CONSTRAINT_VIOLATION) {
120-
$this->logger->debug('Unique constraint violation for live user status');
120+
// A different process might have written another status
121+
// update to the DB while we're processing our stuff.
122+
// We can safely ignore it as we're only changing between AWAY and ONLINE
123+
// and not doing anything with the message or icon.
124+
$this->logger->debug('Unique constraint violation for live user status', ['exception' => $e]);
121125
return;
122126
}
123127
throw $e;

0 commit comments

Comments
 (0)