From d4bef52e1fd5cdaecc95b6be0446fbde7ebb4e03 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Wed, 16 Jul 2014 11:54:02 +0530 Subject: [PATCH] fix supervisor, fix #16 --- bench/cli.py | 6 +++--- bench/utils.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bench/cli.py b/bench/cli.py index e5e52512..8400670f 100644 --- a/bench/cli.py +++ b/bench/cli.py @@ -7,7 +7,7 @@ from .utils import setup_auto_update as _setup_auto_update from .utils import setup_sudoers as _setup_sudoers from .utils import start as _start from .utils import setup_procfile as _setup_procfile -from .utils import build_assets, patch_sites, exec_cmd, update_bench, get_frappe, setup_logging, get_config, update_config +from .utils import build_assets, patch_sites, exec_cmd, update_bench, get_frappe, setup_logging, get_config, update_config, restart_supervisor_processes from .app import get_app as _get_app from .app import new_app as _new_app from .app import pull_all_apps @@ -84,12 +84,12 @@ def update(pull=False, patch=False, build=False, bench=False, auto=False, restar if build: build_assets() if restart_supervisor or conf.get('restart_supervisor_on_update'): - restart() + restart_supervisor_processes() @click.command('restart') def restart(): "Restart supervisor processes" - exec_cmd("sudo supervisorctl restart frappe:") + restart_supervisor_processes() @click.command('start') def start(): diff --git a/bench/utils.py b/bench/utils.py index a9b19d13..214116e0 100644 --- a/bench/utils.py +++ b/bench/utils.py @@ -163,3 +163,6 @@ def get_cmd_output(cmd, cwd='.'): except subprocess.CalledProcessError, e: print "Error:", e.output raise + +def restart_supervisor_processes(): + exec_cmd("sudo supervisorctl restart frappe:")