mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
cron can sometimes fail when the database is not fully initialized, retries the cron job several times and catch catch the error on failure
This commit is contained in:
parent
ca8c2d6120
commit
454e9f55bb
5 changed files with 30 additions and 5 deletions
|
@ -78,7 +78,12 @@ then
|
||||||
systemctl enable --now ${app}-notify-push-watcher.path
|
systemctl enable --now ${app}-notify-push-watcher.path
|
||||||
ynh_add_systemd_config --service="${app}-notify-push"
|
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 ! exec_occ background:cron && [[ $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
|
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
|
systemctl enable --now ${app}-notify-push-watcher.path
|
||||||
ynh_add_systemd_config --service="${app}-notify-push"
|
ynh_add_systemd_config --service="${app}-notify-push"
|
||||||
|
|
||||||
exec_occ background:cron
|
count=0
|
||||||
|
while ! exec_occ background:cron && [[ $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-watcher" --action=restart
|
||||||
ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd"
|
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 ]
|
if [ $enable_notify_push -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php
|
count=0
|
||||||
|
while ! exec_occ background:cron && [[ $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-watcher" --action=restart
|
||||||
ynh_systemd_action --service_name="${app}-notify-push" --action=restart --line_match="Push daemon for Nextcloud clients." --log_path="systemd"
|
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 ]
|
if [ $enable_notify_push -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php
|
count=0
|
||||||
|
while ! exec_occ background:cron && [[ $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-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
|
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 ]
|
if [ $enable_notify_push -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_exec_as "$app" php${phpversion} --define apc.enable_cli=1 $install_dir/cron.php
|
count=0
|
||||||
|
while ! exec_occ background:cron && [[ $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-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
|
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