MCPcopy Index your code
hub / github.com/coder/coder / publishSnapshot

Method publishSnapshot

agent/filefinder/engine.go:352–364  ·  view source on GitHub ↗

publishSnapshot builds and atomically publishes a new snapshot. Must be called with e.mu held.

()

Source from the content-addressed store, hash-verified

350// publishSnapshot builds and atomically publishes a new snapshot.
351// Must be called with e.mu held.
352func (e *Engine) publishSnapshot() {
353 roots := make([]*rootSnapshot, 0, len(e.roots))
354 for _, rs := range e.roots {
355 roots = append(roots, &rootSnapshot{
356 root: rs.root,
357 snap: rs.index.Snapshot(),
358 })
359 }
360 slices.SortFunc(roots, func(a, b *rootSnapshot) int {
361 return strings.Compare(a.root, b.root)
362 })
363 e.snap.Store(&roots)
364}

Callers 4

AddRootMethod · 0.95
RemoveRootMethod · 0.95
RebuildMethod · 0.95
applyEventsMethod · 0.95

Calls 3

SnapshotMethod · 0.80
CompareMethod · 0.80
StoreMethod · 0.45

Tested by

no test coverage detected