Skip to content

Commit 4c6d59e

Browse files
committed
Tweak flushing logic to better match #4664
They'll still merge conflict, but the resolution will be trivial now (I'm trying avoid making one depend on the other)
1 parent 893e1da commit 4c6d59e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

mypy/dmypy_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,7 @@ def check_fine_grained(self, sources: List[mypy.build.BuildSource]) -> Dict[str,
253253
def initialize_fine_grained(self, sources: List[mypy.build.BuildSource]) -> Dict[str, Any]:
254254
# The file system cache we create gets passed off to
255255
# BuildManager, and thence to FineGrainedBuildManager, which
256-
# assumes responsibility for clearing it at the appropriate
257-
# times (after init and update()).
256+
# assumes responsibility for clearing it after updates.
258257
fscache = FileSystemCache(self.options.python_version)
259258
self.fswatcher = FileSystemWatcher(fscache)
260259
self.update_sources(sources)
@@ -295,6 +294,7 @@ def initialize_fine_grained(self, sources: List[mypy.build.BuildSource]) -> Dict
295294
# Run an update
296295
messages = self.fine_grained_manager.update(self.find_changed(sources))
297296

297+
fscache.flush()
298298
status = 1 if messages else 0
299299
return {'out': ''.join(s + '\n' for s in messages), 'err': '', 'status': status}
300300

mypy/server/update.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ def __init__(self, result: BuildResult) -> None:
175175
manager.saved_cache = {}
176176
# Active triggers during the last update
177177
self.triggered = [] # type: List[str]
178-
self.manager.fscache.flush()
179178

180179
def update(self, changed_modules: List[Tuple[str, str]]) -> List[str]:
181180
"""Update previous build result by processing changed modules.

mypy/test/testfinegrained.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def run_case(self, testcase: DataDrivenTestCase) -> None:
8686

8787
fine_grained_manager = None
8888
if not self.use_cache:
89+
result.manager.fscache.flush()
8990
fine_grained_manager = FineGrainedBuildManager(result)
9091
if CHECK_CONSISTENCY:
9192
check_consistency(fine_grained_manager)

0 commit comments

Comments
 (0)