Repository navigation
Commit 0b8d8aa
committed
fix(scanner): re-enrich the local node on the peer refresh tick
The local node GPU, CPU and memory figures were captured once and then never
refreshed. onBrowse deliberately skips our own entry because self is
registry-driven, and publishSelf is otherwise only called when the registry
moves: a service (un)register, an identity change, an address change. Nothing
was left to converge the numbers.
Measured on an RTX 3060: a model was loaded and the card went to 9.1 GB, while
the directory kept serving the 0.12 GB it held at daemon start. node-info was
serving the true value every two seconds the whole time, and the desktop UI
showed it, because the UI reads the node directly rather than through this
snapshot. Only consumers of the discovery snapshot saw the frozen value.
A peer converges because every browse event re-enriches it. Self now converges
too, on the same peerRefreshInterval tick that already refreshes addresses,
mesh, cluster identity and models. Verified live: load a model, and the
directory follows within 20s instead of never.
Note that publishSelf emits node-updated unconditionally, so this adds one
self update per tick. The alternative is an applyInfo path with a
changed check, mirroring applyModels; that is the larger change.
Signed-off-by: canja006 <82221082+canja006@users.noreply.github.com>1 parent 13b6811 commit 0b8d8aa
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1467 | 1467 | | |
1468 | 1468 | | |
1469 | 1469 | | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
1470 | 1481 | | |
1471 | 1482 | | |
1472 | 1483 | | |
| |||
0 commit comments