Merge pull request #12913 from appwrite/cursor/mongo-healthcheck-primary-c625

Fix MongoDB healthcheck false-positive before replica-set primary
This commit is contained in:
Chirag Aggarwal authored and GitHub committed 2026-07-20 10:48:17 +05:30
commit aae6d5aa86
1 file changed
+1 -1
+1 -1
View File
@@ -1306,7 +1306,7 @@ services:
mongosh -u root -p ${_APP_DB_ROOT_PASS} --authenticationDatabase admin --quiet --eval \"
try {
const hello = db.adminCommand({hello: 1});
if (hello.isWritablePrimary) {
if (hello.isWritablePrimary && hello.setName === 'rs0') {
quit(0);
}
} catch (e) {}