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:
commit
4c8bcebc6a
5 changed files with 30 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue