Skip to content

Commit 12d6516

Browse files
committed
back off gist restore in parallel restore case to avoid race condition
1 parent adde328 commit 12d6516

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

bin/ghe-restore

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,18 @@ echo \"$cmd_title\"
560560
ghe-restore-repositories \"$GHE_HOSTNAME\"")
561561

562562
cmd_title=$(log_info "Restoring Gists ...")
563-
commands+=("
564-
echo \"$cmd_title\"
565-
ghe-restore-repositories-gist \"$GHE_HOSTNAME\"")
563+
if [ "$GHE_PARALLEL_ENABLED" = "yes" ]; then
564+
## Stagger ghe-restore-repositories-gist with ghe-restore-repositories to avoid
565+
## race condition to operate on same destination directory
566+
commands+=("
567+
echo \"$cmd_title\"
568+
sleep 1
569+
ghe-restore-repositories-gist \"$GHE_HOSTNAME\"")
570+
else
571+
commands+=("
572+
echo \"$cmd_title\"
573+
ghe-restore-repositories-gist \"$GHE_HOSTNAME\"")
574+
fi
566575

567576
if [ "$GHE_BACKUP_PAGES" != "no" ]; then
568577
cmd_title=$(log_info "Restoring Pages ...")

0 commit comments

Comments
 (0)