From d2fa4f33b6dbab7a3ff8a72a3c8f105fee914b39 Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Tue, 16 May 2023 17:08:37 +0200 Subject: [PATCH] Feat: add logs --- src/Queue.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Queue.php b/src/Queue.php index 7500af6..68e1669 100644 --- a/src/Queue.php +++ b/src/Queue.php @@ -90,6 +90,7 @@ public function pop(TimestampRange $timestampRange = new TimestampRange(), int $ $this->client->del($dataKey); $this->client->zRem($this->timestampIndexKey, $id); if ($this->client->exec() === false) { + trigger_error('Unable to exec', E_USER_WARNING); continue; } return new Message($id, $message->getTimestamp(), $message->getData()); @@ -100,10 +101,12 @@ 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);