Skip to content

Commit 99a1150

Browse files
committed
fix(snowflake): cast lastId to int
Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent 9cd337b commit 99a1150

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/private/Preview/Db/PreviewMapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ public function deleteAll(): void {
204204
/**
205205
* @return \Generator<Preview>
206206
*/
207-
public function getPreviews(int $lastId, int $limit = 1000): \Generator {
207+
public function getPreviews(string $lastId, int $limit = 1000): \Generator {
208208
$qb = $this->db->getQueryBuilder();
209209
$this->joinLocation($qb)
210-
->where($qb->expr()->gt('p.id', $qb->createNamedParameter($lastId, IQueryBuilder::PARAM_INT)))
210+
->where($qb->expr()->gt('p.id', $qb->createNamedParameter($lastId)))
211211
->setMaxResults($limit);
212212
return $this->yieldEntities($qb);
213213

lib/private/Preview/PreviewService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function getPreviewsForMimeTypes(array $mimeTypes): \Generator {
110110
* @throws Exception
111111
*/
112112
public function deleteAll(): void {
113-
$lastId = 0;
113+
$lastId = '0';
114114
while (true) {
115115
$previews = $this->previewMapper->getPreviews($lastId, 1000);
116116
$i = 0;

0 commit comments

Comments
 (0)