Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fbd23bf

Browse files
authored
Some daemon code cleanup (#4341)
* Move GcLogger to its own file; fixes #4194 * Rationalize and document exceptions raised by receive(). * Various changes to dmypy - Move do_restart() and wait_for_server() right after do_start() - Introduce BadStatus exception, use instead of SystemExit - Add a timeout option to request(), use for stop/status - Include all socket ops in the try/except clause - Misc cleanup * Make status quiet by default - Use status -v for the old behavior - replace -q flags with -v flags - Change the way command line arg parsers are updated (for easier copying) - If 'error' in response, sys.exit with that message - Make timeout a genuine keyword arg - Other minor cleanups * Record stats when keeping a tree in memory (bypassing the queue) * Update docstring for write_cache() * Clean up exception handling. Refactor do_restart() to call do_stop() and shared code with do_start() * Improve request() docstring * More tweaks - Add docstring to BadStatus (so I won't have to explain it elsewhere) - Get rid of "except Exception" altogether, simplifying things quite a bit - Add a few clarifying comments when BadStatus is caught (or not) - Fix signature of @action()
1 parent 5f8aaf6 commit fbd23bf

5 files changed

Lines changed: 227 additions & 167 deletions

File tree

mypy/build.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,8 +1156,11 @@ def write_cache(id: str, path: str, tree: MypyFile,
11561156
tree: the fully checked module data
11571157
dependencies: module IDs on which this module depends
11581158
suppressed: module IDs which were suppressed as dependencies
1159+
child_modules: module IDs which are this package's direct submodules
11591160
dep_prios: priorities (parallel array to dependencies)
11601161
old_interface_hash: the hash from the previous version of the data cache file
1162+
source_hash: the hash of the source code
1163+
ignore_all: the ignore_all flag for this module
11611164
manager: the build manager (for pyversion, log/trace)
11621165
11631166
Returns:
@@ -2268,7 +2271,9 @@ def process_graph(graph: Graph, manager: BuildManager) -> None:
22682271

22692272
scc_str = " ".join(scc)
22702273
if fresh:
2271-
if not maybe_reuse_in_memory_tree(graph, scc, manager):
2274+
if maybe_reuse_in_memory_tree(graph, scc, manager):
2275+
manager.add_stats(sccs_kept=1, nodes_kept=len(scc))
2276+
else:
22722277
manager.trace("Queuing %s SCC (%s)" % (fresh_msg, scc_str))
22732278
fresh_scc_queue.append(scc)
22742279
else:

0 commit comments

Comments
 (0)