File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,26 @@ export DOCS_RS_DOCKER=true
7
7
export RUST_LOG=cratesfyi,rustwide=info
8
8
export PATH=" $PATH :/build/target/release"
9
9
10
- cratesfyi database migrate
10
+ # Try migrating the database multiple times if it fails
11
+ # This avoids the docker container crashing the first time it's started with
12
+ # docker-compose, as PostgreSQL needs some time to initialize.
13
+ set +e
14
+ failed=0
15
+ while true ; do
16
+ if ! cratesfyi database migrate; then
17
+ (( failed= failed + 1 ))
18
+ if [ " ${failed} " -eq 5 ]; then
19
+ exit 1
20
+ fi
21
+ echo " failed to migrate the database"
22
+ echo " waiting 1 second..."
23
+ sleep 1
24
+ else
25
+ break
26
+ fi
27
+ done
28
+ set -e
29
+
11
30
cratesfyi database update-search-index
12
31
cratesfyi database update-release-activity
13
32
You can’t perform that action at this time.
0 commit comments