diff options
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/ops/roots.py')
| -rw-r--r-- | packages/meshbay-node/src/meshbay_node/ops/roots.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/ops/roots.py b/packages/meshbay-node/src/meshbay_node/ops/roots.py index 187e134..0cd2daa 100644 --- a/packages/meshbay-node/src/meshbay_node/ops/roots.py +++ b/packages/meshbay-node/src/meshbay_node/ops/roots.py @@ -361,13 +361,16 @@ async def pause_root(state: dict, group_id: str, root_name: str) -> dict: async def resume_root(state: dict, group_id: str, root_name: str) -> dict: """Index a paused root again; the walk runs in the background.""" roots, root = _live_root(state, group_id, root_name) - if not root.paused: + indexer = state.get("indexers", {}).get(group_id) + # A root the node paused by itself, its disk having stopped answering, is + # paused on the indexer's own set and nowhere in the roster. + own = indexer.roots.by_name(root.name) if indexer else None + if not root.paused and not (own is not None and own.paused): return {"status": "already_resumed", "name": root.name, "group_id": group_id, "roots": roots.describe()} await _roster(state).set_root_paused( group_id, root.name, False, set_by=state.get("node_user_id", "")) - indexer = state.get("indexers", {}).get(group_id) if indexer: await indexer.resume_root(root.name) root.paused = False |