mirror of
https://github.com/frappe/bench.git
synced 2025-02-13 16:28:32 +00:00
[fix] use_rq
This commit is contained in:
parent
df74bb130b
commit
6612c6d6ca
@ -117,6 +117,11 @@ def get_current_branch(app, bench='.'):
|
|||||||
repo_dir = get_repo_dir(app, bench=bench)
|
repo_dir = get_repo_dir(app, bench=bench)
|
||||||
return get_cmd_output("basename $(git symbolic-ref -q HEAD)", cwd=repo_dir)
|
return get_cmd_output("basename $(git symbolic-ref -q HEAD)", cwd=repo_dir)
|
||||||
|
|
||||||
|
def use_rq(bench_path):
|
||||||
|
bench_path = os.path.abspath(bench_path)
|
||||||
|
celery_app = os.path.join(bench_path, 'apps', 'frappe', 'frappe', 'celery_app.py')
|
||||||
|
return not os.path.exists(celery_app)
|
||||||
|
|
||||||
def fetch_upstream(app, bench='.'):
|
def fetch_upstream(app, bench='.'):
|
||||||
repo_dir = get_repo_dir(app, bench=bench)
|
repo_dir = get_repo_dir(app, bench=bench)
|
||||||
return exec_cmd("git fetch upstream", cwd=repo_dir)
|
return exec_cmd("git fetch upstream", cwd=repo_dir)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import bench, os, click
|
import bench, os, click
|
||||||
from bench.utils import find_executable
|
from bench.utils import find_executable
|
||||||
from bench.app import get_current_frappe_version, get_current_branch
|
from bench.app import use_rq
|
||||||
from bench.config.common_site_config import get_config
|
from bench.config.common_site_config import get_config
|
||||||
|
|
||||||
def setup_procfile(bench_path, force=False):
|
def setup_procfile(bench_path, force=False):
|
||||||
@ -12,8 +12,7 @@ def setup_procfile(bench_path, force=False):
|
|||||||
|
|
||||||
procfile = bench.env.get_template('Procfile').render(
|
procfile = bench.env.get_template('Procfile').render(
|
||||||
node=find_executable("node") or find_executable("nodejs"),
|
node=find_executable("node") or find_executable("nodejs"),
|
||||||
frappe_version=get_current_frappe_version(bench_path),
|
use_rq=use_rq(bench_path),
|
||||||
frappe_branch=get_current_branch('frappe', bench_path),
|
|
||||||
webserver_port=config.get('webserver_port'))
|
webserver_port=config.get('webserver_port'))
|
||||||
|
|
||||||
with open(procfile_path, 'w') as f:
|
with open(procfile_path, 'w') as f:
|
||||||
|
@ -2,7 +2,7 @@ import os, getpass, click
|
|||||||
import bench
|
import bench
|
||||||
|
|
||||||
def generate_supervisor_config(bench_path, user=None, force=False):
|
def generate_supervisor_config(bench_path, user=None, force=False):
|
||||||
from bench.app import get_current_frappe_version, get_current_branch
|
from bench.app import get_current_frappe_version, use_rq
|
||||||
from bench.utils import get_bench_name, find_executable
|
from bench.utils import get_bench_name, find_executable
|
||||||
from bench.config.common_site_config import get_config, update_config, get_gunicorn_workers
|
from bench.config.common_site_config import get_config, update_config, get_gunicorn_workers
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ def generate_supervisor_config(bench_path, user=None, force=False):
|
|||||||
"sites_dir": os.path.join(bench_dir, 'sites'),
|
"sites_dir": os.path.join(bench_dir, 'sites'),
|
||||||
"user": user,
|
"user": user,
|
||||||
"frappe_version": get_current_frappe_version(bench_path),
|
"frappe_version": get_current_frappe_version(bench_path),
|
||||||
"frappe_branch": get_current_branch('frappe', bench_path),
|
"use_rq": use_rq(bench_path),
|
||||||
"http_timeout": config.get("http_timeout", 120),
|
"http_timeout": config.get("http_timeout", 120),
|
||||||
"redis_server": find_executable('redis-server'),
|
"redis_server": find_executable('redis-server'),
|
||||||
"node": find_executable('node') or find_executable('nodejs'),
|
"node": find_executable('node') or find_executable('nodejs'),
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
{%- set use_rq = (frappe_branch=='develop' or frappe_version >= 7) -%}
|
|
||||||
redis_cache: redis-server config/redis_cache.conf
|
redis_cache: redis-server config/redis_cache.conf
|
||||||
redis_socketio: redis-server config/redis_socketio.conf
|
redis_socketio: redis-server config/redis_socketio.conf
|
||||||
redis_queue: redis-server config/redis_queue.conf
|
redis_queue: redis-server config/redis_queue.conf
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
{%- set use_rq = (frappe_branch=='develop' or frappe_version >= 7) -%}
|
|
||||||
; Notes:
|
; Notes:
|
||||||
; priority=1 --> Lower priorities indicate programs that start first and shut down last
|
; priority=1 --> Lower priorities indicate programs that start first and shut down last
|
||||||
; killasgroup=true --> send kill signal to child processes too
|
; killasgroup=true --> send kill signal to child processes too
|
||||||
|
Loading…
x
Reference in New Issue
Block a user