1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

Merge pull request #720 from YunoHost-Apps/trying-to-fix-the-cron-task

cron can sometimes fail when the database is not fully initialized, r…
This commit is contained in:
Kayou 2024-08-27 14:14:34 +02:00 committed by GitHub
commit 4c8bcebc6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 5 deletions

View file

@ -78,7 +78,12 @@ then
systemctl enable --now ${app}-notify-push-watcher.path
ynh_add_systemd_config --service="${app}-notify-push"
ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php
count=0
while ! ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php && [[ $count -lt 30 ]]
do
sleep 1
count=$((count + 1))
done
ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd" --action=restart

View file

@ -141,7 +141,12 @@ set__enable_notify_push() {
systemctl enable --now ${app}-notify-push-watcher.path
ynh_add_systemd_config --service="${app}-notify-push"
exec_occ background:cron
count=0
while ! ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php && [[ $count -lt 30 ]]
do
sleep 1
count=$((count + 1))
done
ynh_systemd_action --service_name="${app}-notify-push-watcher" --action=restart
ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd"

View file

@ -299,7 +299,12 @@ ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.*
if [ $enable_notify_push -eq 1 ]
then
ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php
count=0
while ! ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php && [[ $count -lt 30 ]]
do
sleep 1
count=$((count + 1))
done
ynh_systemd_action --service_name="${app}-notify-push-watcher" --action=restart
ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd"

View file

@ -162,7 +162,12 @@ exec_occ() {
if [ $enable_notify_push -eq 1 ]
then
ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php
count=0
while ! ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php && [[ $count -lt 30 ]]
do
sleep 1
count=$((count + 1))
done
ynh_systemd_action --service_name="${app}-notify-push-watcher" --action=restart
ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd" --action=restart

View file

@ -443,7 +443,12 @@ ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.*
if [ $enable_notify_push -eq 1 ]
then
ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php
count=0
while ! ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php && [[ $count -lt 30 ]]
do
sleep 1
count=$((count + 1))
done
ynh_systemd_action --service_name="${app}-notify-push-watcher" --action=restart
ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd" --action=restart