MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / SetBeforeMoveLockForTesting

Method SetBeforeMoveLockForTesting

internal/store/testing_helpers.go:292–296  ·  view source on GitHub ↗

SetBeforeMoveLockForTesting installs the beforeMoveLock seam (BUG-3665) for the lifetime of the returned restore function: a move calls hook after its pre-lock read of the item and before it takes the workspace lock.

(hook func(itemID string))

Source from the content-addressed store, hash-verified

290// the lifetime of the returned restore function: a move calls hook after its
291// pre-lock read of the item and before it takes the workspace lock.
292func (s *Store) SetBeforeMoveLockForTesting(hook func(itemID string)) (restore func()) {
293 prev := s.beforeMoveLock
294 s.beforeMoveLock = hook
295 return func() { s.beforeMoveLock = prev }
296}
297
298// SetBeforeItemVersionsReadHookForTesting runs hook at the start of every
299// version-list read (ListItemVersionsPage and the snapshot read), before its

Calls

no outgoing calls