2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-28 06:49:06 +00:00

fix: Clear Bench instance cache on every chdir

This commit is contained in:
Gavin D'souza 2021-12-02 14:22:34 +05:30
parent 814bcc6320
commit ec369a16a1

View File

@ -51,6 +51,7 @@ def cli():
change_working_directory()
logger = setup_logging()
logger.info(command)
setup_clear_cache()
bench_config = get_config(".")
@ -216,3 +217,14 @@ def change_working_directory():
if 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