ansible/test/integration/targets/mongodb_user/files/js/is_primary.js
Rhys Campbell 609c3d0e36 mongodb_user module integration tests (#61257)
* Add final commits

* End of night commit

* Add further tests

* What is this doing here?

* Remove file from commit

* Change os check

* Change version check
2020-01-09 09:22:45 -05:00

13 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.");
}
}