Merge pull request #6743 from nextcloud/enh/noid/add-safeguard-to-fts

nextcloud-entrypoint: do not wait indefinitely if FTS is not reachable
This commit is contained in:
Simon L. 2025-08-14 10:40:45 +02:00 committed by GitHub
commit d0ba9278f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -828,10 +828,18 @@ fi
# Fulltextsearch
if [ "$FULLTEXTSEARCH_ENABLED" = 'yes' ]; then
while ! nc -z "$FULLTEXTSEARCH_HOST" "$FULLTEXTSEARCH_PORT"; do
count=0
while ! nc -z "$FULLTEXTSEARCH_HOST" "$FULLTEXTSEARCH_PORT" && [ "$count" -lt 90 ]; do
echo "waiting for Fulltextsearch to become available..."
count=$((count+5))
sleep 5
done
if [ "$count" -ge 90 ]; then
echo "Fulltextsearch did not start in time. Skipping initialization and disabling fulltextsearch apps."
php /var/www/html/occ app:disable fulltextsearch
php /var/www/html/occ app:disable fulltextsearch_elasticsearch
php /var/www/html/occ app:disable files_fulltextsearch
else
if ! [ -d "/var/www/html/custom_apps/fulltextsearch" ]; then
php /var/www/html/occ app:install fulltextsearch
elif [ "$(php /var/www/html/occ config:app:get fulltextsearch enabled)" != "yes" ]; then
@ -869,6 +877,7 @@ if [ "$FULLTEXTSEARCH_ENABLED" = 'yes' ]; then
echo "Feel free to follow https://github.com/nextcloud/all-in-one/discussions/1709 if you want to skip the indexing in the future."
fi
fi
fi
else
if [ "$REMOVE_DISABLED_APPS" = yes ]; then
if [ -d "/var/www/html/custom_apps/fulltextsearch" ]; then