Skip to content

Commit

Permalink
Give mongo an additional 50 seconds to be ready to init replica set
Browse files Browse the repository at this point in the history
  • Loading branch information
eecavanna committed Jan 29, 2025
1 parent 50c9757 commit 91f7887
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .docker/mongo/ensure_replica_set_is_initialized.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

echo '
try {
// Note: If the replica set is not initiated yet, the invoked function will
// throw an error, which will be caught below.
rs.status();
} catch (e) {
rs.initiate({ _id: "rs0", members: [{ _id: 0, host: "localhost" }] });
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ services:
#
healthcheck:
test: /bin/sh /ensure_replica_set_is_initialized.sh
start_period: 10s
start_interval: 1s
start_period: 1m
start_interval: 5s
interval: 10m

test:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ services:
#
healthcheck:
test: /bin/sh /ensure_replica_set_is_initialized.sh
start_period: 10s
start_interval: 1s
start_period: 1m
start_interval: 5s
interval: 10m

volumes:
Expand Down

0 comments on commit 91f7887

Please sign in to comment.