Skip to content

Commit e33a835

Browse files
committed
cleanup
1 parent d8217bb commit e33a835

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/BasicTransport/FileTransport.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,12 @@ public function fetchUnprocessedMessages(int $batchSize = -1): ?iterable
7272
$returnedItems = 0;
7373

7474
foreach ($this->fileIndexProcessed[0] ?? [] as $position) {
75-
fseek($this->fp, $position + 1);
76-
$rawMessage = fgets($this->fp);
75+
fseek($this->fp, $position);
76+
$rawMessage = trim(fgets($this->fp));
77+
78+
if (strlen($rawMessage) === 0) {
79+
continue;
80+
}
7781

7882
$message = Message::fromArray(json_decode($rawMessage, true,512, JSON_THROW_ON_ERROR));
7983

0 commit comments

Comments
 (0)