Skip to content

Commit

Permalink
Change mycodoflask reload to restart
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Jan 6, 2025
1 parent 14e5267 commit 9e2c144
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion mycodo/mycodo_flask/utils/utils_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2044,7 +2044,7 @@ def settings_diagnostic_upgrade_master():
error, action, url_for('routes_settings.settings_diagnostic'))
return
finally:
command = '/bin/bash {path}/mycodo/scripts/upgrade_commands.sh web-server-reload'.format(
command = '/bin/bash {path}/mycodo/scripts/upgrade_commands.sh web-server-restart'.format(
path=INSTALL_DIRECTORY)
subprocess.Popen(command, shell=True)

Expand Down
11 changes: 1 addition & 10 deletions mycodo/scripts/upgrade_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ Options:
upgrade-master Upgrade Mycodo to the master branch at https://github.com/kizniche/Mycodo
upgrade-post Execute post-upgrade script
web-server-connect Attempt to connect to the web server
web-server-reload Reload the web server
web-server-restart Restart the web server
web-server-disable Disable the web server service
web-server-enable Enable the web server service
Expand Down Expand Up @@ -686,21 +685,13 @@ case "${1:-''}" in
printf "#### Trying again...\n"
done
;;
'web-server-reload')
'web-server-restart')
printf "\n#### Restarting nginx\n"
service nginx restart
sleep 5
printf "#### Reloading mycodoflask\n"
service mycodoflask reload
;;
'web-server-restart')
printf "\n#### Restarting nginx\n"
service nginx restart
sleep 5
printf "#### Restarting mycodoflask\n"
service mycodoflask restart
sleep 5
;;
'web-server-disable')
printf "\n#### Disabling service for nginx web server\n"
systemctl disable mycodoflask.service
Expand Down
8 changes: 4 additions & 4 deletions mycodo/scripts/upgrade_post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ TIMER_START_restart_daemon=$SECONDS
${INSTALL_CMD} restart-daemon
TIMER_TOTAL_restart_daemon=$((SECONDS - TIMER_START_restart_daemon))

TIMER_START_web_server_reload=$SECONDS
${INSTALL_CMD} web-server-reload
TIMER_TOTAL_web_server_reload=$((SECONDS - TIMER_START_web_server_reload))
TIMER_START_web_server_restart=$SECONDS
${INSTALL_CMD} web-server-restart
TIMER_TOTAL_web_server_restart=$((SECONDS - TIMER_START_web_server_restart))

TIMER_START_web_server_connect=$SECONDS
${INSTALL_CMD} web-server-connect
Expand All @@ -135,5 +135,5 @@ printf "\ncompile-translations: %s s" "${TIMER_TOTAL_compile_translation
printf "\ngenerate-widget-html: %s s" "${TIMER_TOTAL_generate_widget_html}"
printf "\nupdate-permissions: %s s" "${TIMER_TOTAL_update_permissions}"
printf "\nrestart-daemon: %s s" "${TIMER_TOTAL_restart_daemon}"
printf "\nweb-server_reload: %s s" "${TIMER_TOTAL_web_server_reload}"
printf "\nweb-server_restart: %s s" "${TIMER_TOTAL_web_server_restart}"
printf "\nweb-server-connect: %s s\n" "${TIMER_TOTAL_web_server_connect}"

0 comments on commit 9e2c144

Please sign in to comment.