From 35bfd66b5be3b5849a6d2e183be40a7c4b032bca Mon Sep 17 00:00:00 2001 From: ayasayadi1 Date: Mon, 30 Oct 2023 13:13:20 +0000 Subject: [PATCH] fixed cursor closed condition --- bin/scripts/fix-data/recheck_merges.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/scripts/fix-data/recheck_merges.js b/bin/scripts/fix-data/recheck_merges.js index ace60b0d00d..709c717149d 100755 --- a/bin/scripts/fix-data/recheck_merges.js +++ b/bin/scripts/fix-data/recheck_merges.js @@ -51,7 +51,7 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection(" await processUser(user.merged_uid, user.uid, collections, app); } //if cursor is closed, recreate it and skip processed users - if (!usersCursor) { + if (usersCursor.isClosed()) { usersCursor = usersCollection.find({merges: {$gt: 0}}, {_id: 1, uid: 1, merged_uid: 1}).skip(processedUsersCount); } }