mirror of
https://github.com/frappe/bench.git
synced 2025-01-25 07:58:24 +00:00
Merge pull request #608 from achillesrasquinha/clear-cache-redis-fb
fallback in case redis isnt running
This commit is contained in:
commit
0f8c6cfed0
@ -95,6 +95,7 @@ def migrate_env(python, no_backup = False):
|
|||||||
"""
|
"""
|
||||||
Migrate Virtual Environment to desired Python Version.
|
Migrate Virtual Environment to desired Python Version.
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
# Clear Cache before Bench Dies.
|
# Clear Cache before Bench Dies.
|
||||||
config = get_config(bench_path = os.getcwd())
|
config = get_config(bench_path = os.getcwd())
|
||||||
rredis = urlparse(config['redis_cache'])
|
rredis = urlparse(config['redis_cache'])
|
||||||
@ -108,6 +109,8 @@ def migrate_env(python, no_backup = False):
|
|||||||
exec_cmd('{redis} FLUSHALL'.format(redis = redis))
|
exec_cmd('{redis} FLUSHALL'.format(redis = redis))
|
||||||
log.debug('Clearing Redis DataBase...')
|
log.debug('Clearing Redis DataBase...')
|
||||||
exec_cmd('{redis} FLUSHDB'.format(redis = redis))
|
exec_cmd('{redis} FLUSHDB'.format(redis = redis))
|
||||||
|
except Exception:
|
||||||
|
log.warn('Please ensure Redis Connections are running or Daemonized.')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# This is with the assumption that a bench is set-up within path.
|
# This is with the assumption that a bench is set-up within path.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user