Skip to content

Commit

Permalink
add retries
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Nov 14, 2024
1 parent 6102651 commit 9b81bd1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .evergreen/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,22 @@ is_python_310() {
}


retry() {
for i in 1 2 4 8 16; do
{ "$@" && return 0; } || sleep $i
done
return 1
}


# start mongodb-atlas-local container, because of a bug in podman we have to define the healtcheck ourselves (is the same as in the image)
# stores the connection string in .local_atlas_uri file
setup_local_atlas() {
echo "Starting the container"

IMAGE=mongodb/mongodb-atlas-local:latest
retry podman pull $IMAGE

CONTAINER_ID=$(podman run --rm -d -e DO_NOT_TRACK=1 -P --health-cmd "/usr/local/bin/runner healthcheck" mongodb/mongodb-atlas-local:latest)

echo "waiting for container to become healthy..."
Expand Down

0 comments on commit 9b81bd1

Please sign in to comment.