mirror of
https://github.com/frappe/bench.git
synced 2024-11-16 01:57:08 +00:00
feat: Restart process manager for develop mode
This commit is contained in:
parent
3709682231
commit
6123cd5b49
@ -18,6 +18,7 @@ from bench.utils.bench import (
|
||||
validate_app_installed_on_sites,
|
||||
restart_supervisor_processes,
|
||||
restart_systemd_processes,
|
||||
restart_process_manager,
|
||||
remove_backups_crontab,
|
||||
get_venv_path,
|
||||
get_env_cmd,
|
||||
@ -129,7 +130,8 @@ class Bench(Base, Validator):
|
||||
restart_supervisor_processes(bench_path=self.name)
|
||||
if conf.get("restart_systemd_on_update"):
|
||||
restart_systemd_processes(bench_path=self.name)
|
||||
|
||||
if conf.get("developer_mode"):
|
||||
restart_process_manager(bench_path=self.name)
|
||||
|
||||
class BenchApps(MutableSequence):
|
||||
def __init__(self, bench: Bench):
|
||||
|
@ -32,14 +32,14 @@ def is_version_upgrade(app="frappe", bench_path=".", branch=None):
|
||||
def switch_branch(branch, apps=None, bench_path=".", upgrade=False, check_upgrade=True):
|
||||
import git
|
||||
import importlib
|
||||
from bench.utils import (
|
||||
from bench.utils.bench import (
|
||||
build_assets,
|
||||
update_requirements,
|
||||
update_node_packages,
|
||||
backup_all_sites,
|
||||
patch_sites,
|
||||
post_upgrade,
|
||||
)
|
||||
from bench.utils.bench import build_assets
|
||||
from bench.utils.system import backup_all_sites
|
||||
|
||||
apps_dir = os.path.join(bench_path, "apps")
|
||||
version_upgrade = (False,)
|
||||
|
@ -12,7 +12,7 @@ import click
|
||||
import bench
|
||||
|
||||
# imports - module imports
|
||||
from bench.utils import which, log, exec_cmd, get_bench_name, get_cmd_output
|
||||
from bench.utils import get_process_manager, which, log, exec_cmd, get_bench_name, get_cmd_output
|
||||
from bench.exceptions import PatchError, ValidationError
|
||||
|
||||
logger = logging.getLogger(bench.PROJECT_NAME)
|
||||
@ -304,6 +304,14 @@ def restart_systemd_processes(bench_path=".", web_workers=False):
|
||||
)
|
||||
|
||||
|
||||
def restart_process_manager(bench_path="."):
|
||||
# only overmind has the restart feature, not sure other supported procmans do
|
||||
if which("overmind") and os.path.exists(
|
||||
os.path.join(bench_path, ".overmind.sock")
|
||||
):
|
||||
exec_cmd("overmind restart", cwd=bench_path)
|
||||
|
||||
|
||||
def build_assets(bench_path=".", app=None):
|
||||
command = "bench build"
|
||||
if app:
|
||||
@ -331,8 +339,8 @@ def update(
|
||||
from bench.utils.bench import (
|
||||
restart_supervisor_processes,
|
||||
restart_systemd_processes,
|
||||
backup_all_sites,
|
||||
)
|
||||
from bench.utils.system import backup_all_sites
|
||||
from bench.app import pull_apps
|
||||
from bench.utils.app import is_version_upgrade
|
||||
from bench.config.common_site_config import update_config
|
||||
|
Loading…
Reference in New Issue
Block a user