mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 17:24:41 +00:00
fix: Clear Bench instance cache on every chdir
This commit is contained in:
parent
814bcc6320
commit
ec369a16a1
12
bench/cli.py
12
bench/cli.py
@ -51,6 +51,7 @@ def cli():
|
|||||||
change_working_directory()
|
change_working_directory()
|
||||||
logger = setup_logging()
|
logger = setup_logging()
|
||||||
logger.info(command)
|
logger.info(command)
|
||||||
|
setup_clear_cache()
|
||||||
|
|
||||||
bench_config = get_config(".")
|
bench_config = get_config(".")
|
||||||
|
|
||||||
@ -216,3 +217,14 @@ def change_working_directory():
|
|||||||
|
|
||||||
if bench_path:
|
if bench_path:
|
||||||
os.chdir(bench_path)
|
os.chdir(bench_path)
|
||||||
|
|
||||||
|
|
||||||
|
def setup_clear_cache():
|
||||||
|
from copy import copy
|
||||||
|
f = copy(os.chdir)
|
||||||
|
|
||||||
|
def _chdir(*args, **kwargs):
|
||||||
|
Bench.cache_clear()
|
||||||
|
return f(*args, **kwargs)
|
||||||
|
|
||||||
|
os.chdir = _chdir
|
||||||
|
Loading…
Reference in New Issue
Block a user