Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Fix: move log to correct place
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrime-ru committed May 17, 2023
1 parent e585112 commit 3ee8bf9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function pop(TimestampRange $timestampRange = new TimestampRange(), int $
$this->client->watch($dataKey);
$message = $this->getMessage($id);
if ($message === null) {
trigger_error('Message not found', E_USER_WARNING);
$this->client->unwatch();
continue;
}
Expand All @@ -101,12 +102,10 @@ public function pop(TimestampRange $timestampRange = new TimestampRange(), int $
private function getMessage(string $id): ?Message {
$timestamp = $this->client->zScore($this->timestampIndexKey, $id);
if ($timestamp === null) {
trigger_error('zScore not found', E_USER_WARNING);
return null;
}
$data = $this->client->get($this->getDataKey($id));
if ($data === null) {
trigger_error('Data key not found', E_USER_WARNING);
return null;
}
return new Message($id, $timestamp, $data);
Expand Down

0 comments on commit 3ee8bf9

Please sign in to comment.