Skip to content

Commit 2196f05

Browse files
committed
Do not remove the jedi cache on warm up
1 parent 5265842 commit 2196f05

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

scripts/jedi_cache.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,20 @@ def setup_jedi():
9393
print("default jedi environment", jedi.api.environment.get_default_environment())
9494
print("jedi environment", ENV)
9595
jedi_cache = pathlib.Path(jedi.settings.cache_directory)
96-
if jedi_cache.exists():
97-
shutil.rmtree(jedi_cache)
98-
print("removed jedi cache!")
99-
else:
100-
print("no jedi cache was found!")
96+
return jedi_cache.exists()
10197

10298

10399
def warm_up(modules):
104100
print_env()
105101
print("-" * 80)
106102
print_versions()
107103
print("-" * 80)
108-
setup_jedi()
104+
cache_exists = setup_jedi()
105+
if cache_exists:
106+
print("jedi cache already exists, aborting warm up!")
107+
return
108+
else:
109+
print("no jedi cache was found, warming up!")
109110
print("-" * 80)
110111
start = time.time()
111112
[warm_up_one(module) for module in modules]
@@ -115,4 +116,4 @@ def warm_up(modules):
115116

116117

117118
if __name__ == "__main__":
118-
warm_up(sorted(set(sys.argv[1:] or MODULES_TO_CACHE)))
119+
warm_up(sorted(set(sys.argv[2:] or MODULES_TO_CACHE)))

0 commit comments

Comments
 (0)