Skip to content

Commit 85b2234

Browse files
committed
fix: enhance lastId check to include members synced condition for early termination
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent 5169941 commit 85b2234

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

services/libs/opensearch/src/apiClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class SearchSyncApiClient {
5656
const result: { lastId: string | null; membersSynced: number } = data
5757
totalSynced += result.membersSynced
5858

59-
if (result.lastId === null) {
59+
if (result.lastId === null || result.membersSynced < pageSize) {
6060
return { totalSynced }
6161
}
6262

0 commit comments

Comments
 (0)