Merge pull request #3214 from nextcloud/enh/noid/add-stop-grace-period-nextcloud

nextcloud - add stop_grace_period of 600s and wait for cron to finish during that time
This commit is contained in:
Simon L 2023-12-01 14:23:42 +01:00 committed by GitHub
commit 890ba86532
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -1,7 +1,20 @@
#!/bin/bash
set -eu
wait_for_cron() {
set -x
while [ -n "$(pgrep -f /var/www/html/cron.php)" ]; do
echo "Waiting for cron to stop..."
sleep 5
done
echo "Cronjob successfully exited."
set +x
}
trap wait_for_cron SIGINT SIGTERM
while true; do
php -f /var/www/html/cron.php &
sleep 5m
sleep 5m &
wait $!
done

View file

@ -215,6 +215,7 @@
"APACHE_IP_BINDING=%APACHE_IP_BINDING%",
"THIS_IS_AIO=true"
],
"stop_grace_period": 600,
"restart": "unless-stopped",
"devices": [
"/dev/dri"