From 88f9a426ac10ac037180fd2509096938c62eb5d8 Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Wed, 11 Sep 2024 18:21:32 +0800 Subject: [PATCH] Fixed `DbSession.get_file_by_blob_hashes` limit handling affected compress method / hash method migration --- prime_backup/db/session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prime_backup/db/session.py b/prime_backup/db/session.py index 480a42b..8cd6fc4 100644 --- a/prime_backup/db/session.py +++ b/prime_backup/db/session.py @@ -237,7 +237,7 @@ def get_file_by_blob_hashes(self, hashes: List[str], *, limit: Optional[int] = N if limit is not None: st = st.limit(max(0, limit - len(result))) result.extend(self.session.execute(st).scalars().all()) - if len(result) >= limit: + if limit is not None and len(result) >= limit: break return result