You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/mongodb_shard/files/js/is_primary.js

14 lines
276 B
JavaScript

var done = false;
var iterations = 0;
while(rs.status()['myState'] != 1) {
if (!done) {
//print("State is not yet PRIMARY. Waiting...");
done = true
}
sleep(1000);
iterations++;
if (iterations == 100) {
throw new Error("Exceeded iterations limit.");
}
}