MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / Unlock

Method Unlock

internal/lock/lock.go:274–285  ·  view source on GitHub ↗

Unlock releases all locks in reverse order of acquisition. Releasing in reverse order is a best practice for multi-lock scenarios. Parameters: - ctx: The context for managing the unlock request lifecycle. Returns an error if any unlock operation fails.

(ctx context.Context)

Source from the content-addressed store, hash-verified

272// - ctx: The context for managing the unlock request lifecycle.
273// Returns an error if any unlock operation fails.
274func (m *MultiLocker) Unlock(ctx context.Context) error {
275 var lastErr error
276
277 // Release locks in reverse order
278 for i := len(m.lockers) - 1; i >= 0; i-- {
279 if err := m.lockers[i].Unlock(ctx); err != nil {
280 lastErr = err
281 }
282 }
283
284 return lastErr
285}
286
287// rollback releases locks that were successfully acquired before a failure.
288// Parameters:

Calls 1

UnlockMethod · 0.45