aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/roots.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/roots.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/roots.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/roots.py b/packages/meshbay-node/src/meshbay_node/roots.py
index 7dded1f..61fdc9b 100644
--- a/packages/meshbay-node/src/meshbay_node/roots.py
+++ b/packages/meshbay-node/src/meshbay_node/roots.py
@@ -182,6 +182,10 @@ class Root:
# such a root comes back on its own once its files are there again
# (`DirectoryIndexer._reconcile`). An operator's eject never does.
auto: bool = False
+ # The operator stopped indexing it: not walked, not watched, not re-checked,
+ # and what was already indexed stays listed. Independent of `available` —
+ # a paused root is readable, and its files are served.
+ paused: bool = False
available: bool = True
@property
@@ -341,14 +345,16 @@ class RootSet:
# Backward compat: old configs use `upload` instead of `writable`
writable = bool(spec.get("writable", spec.get("upload", False)))
- # `ejected` is runtime state, not configuration — it reaches here
- # only from the roster, restored at startup so a drive ejected
- # before a restart does not come back on its own.
+ # `ejected` and `paused` are runtime state, not configuration — they
+ # reach here only from the roster, restored at startup so a drive
+ # ejected before a restart does not come back on its own, and a
+ # paused scan does not start again.
root = Root(name=name, path=path, kind=kind,
writable=writable,
removable=bool(spec.get("removable", False)),
ejected=bool(spec.get("ejected", False)),
auto=bool(spec.get("ejected_auto", False)),
+ paused=bool(spec.get("paused", False)),
available=not bool(spec.get("ejected", False)))
_refuse_nesting(root, roots)
roots.append(root)
@@ -496,7 +502,8 @@ class RootSet:
"available": r.available,
"writable": r.writable,
"removable": r.removable,
- "ejected": r.ejected}
+ "ejected": r.ejected,
+ "paused": r.paused}
# `with_paths` is for the operator's *own* channels only — the
# loopback API and the CLI reading it, both of which already
# require being on this machine with the run token. A member is