1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gitlab_ynh.git synced 2024-09-03 18:36:35 +02:00

[fix] No infinite loop

This commit is contained in:
ljf (zamentur) 2022-04-05 12:12:06 +02:00 committed by GitHub
parent 8a5095f166
commit c9f3c1ae34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -317,8 +317,16 @@ then
# https://docs.gitlab.com/ee/update/#checking-for-background-migrations-before-upgrading
if dpkg --compare-versions "$current_version" "ge" "12.9"; then
counter=0
while ! gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
do
counter=$((counter + 1))
if [ $counter -gt 1200 ]
then
ynh_print_warn --message="Timeout: a background migration runs for at least 20min !"
break
fi
ynh_print_info --message="Wait for the migration in the background to finish"
sleep 1
done