Flush all nodes.
(self)
| 498 | node._f_close() |
| 499 | |
| 500 | def flush_nodes(self) -> None: |
| 501 | """Flush all nodes.""" |
| 502 | # Only iter on the nodes in the registry since nodes in the cache |
| 503 | # should always have an entry in the registry |
| 504 | closed_keys = [] |
| 505 | for path, node in list(self.registry.items()): |
| 506 | if not node._v_isopen: |
| 507 | closed_keys.append(path) |
| 508 | elif "/_i_" not in path: # Indexes are not necessary to be flushed |
| 509 | if isinstance(node, Leaf): |
| 510 | node.flush() |
| 511 | |
| 512 | for path in closed_keys: |
| 513 | # self.cache.pop(path, None) |
| 514 | if path in self.cache: |
| 515 | warnings.warn("closed node the cache: ``%s``" % path) |
| 516 | self.cache.pop(path, None) |
| 517 | self.registry.pop(path) |
| 518 | |
| 519 | @staticmethod |
| 520 | def _close_nodes( |