2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-09 16:36:25 +00:00

Merge branch 'develop' into staging

This commit is contained in:
Gavin D'souza 2022-07-30 01:14:13 +05:30
commit 42e6da6eae
2 changed files with 6 additions and 29 deletions

View File

@ -1,9 +0,0 @@
include *.md
include *.py
recursive-include bench *.conf
recursive-include bench *.sh
recursive-include bench *.py
recursive-include bench *.txt
recursive-include bench *.json
recursive-include bench/config/templates *
recursive-include bench/playbooks *

View File

@ -1,4 +1,5 @@
# imports - standard imports # imports - standard imports
import contextlib
import os import os
import logging import logging
import sys import sys
@ -181,40 +182,25 @@ def is_running_systemd():
def reload_supervisor(): def reload_supervisor():
supervisorctl = which("supervisorctl") supervisorctl = which("supervisorctl")
try: with contextlib.suppress(CommandFailedError):
# first try reread/update # first try reread/update
exec_cmd(f"{supervisorctl} reread") exec_cmd(f"{supervisorctl} reread")
exec_cmd(f"{supervisorctl} update") exec_cmd(f"{supervisorctl} update")
return return
except CommandFailedError: with contextlib.suppress(CommandFailedError):
pass
try:
# something is wrong, so try reloading # something is wrong, so try reloading
exec_cmd(f"{supervisorctl} reload") exec_cmd(f"{supervisorctl} reload")
return return
except CommandFailedError: with contextlib.suppress(CommandFailedError):
pass
try:
# then try restart for centos # then try restart for centos
service("supervisord", "restart") service("supervisord", "restart")
return return
except CommandFailedError: with contextlib.suppress(CommandFailedError):
pass
try:
# else try restart for ubuntu / debian # else try restart for ubuntu / debian
service("supervisor", "restart") service("supervisor", "restart")
return return
except CommandFailedError:
pass
def reload_nginx(): def reload_nginx():
try: exec_cmd(f"sudo {which('nginx')} -t")
exec_cmd(f"sudo {which('nginx')} -t")
except Exception:
raise
service("nginx", "reload") service("nginx", "reload")