MCPcopy Index your code
hub / github.com/devaccuracy/ledgerforge / acquireTransactionLocker

Method acquireTransactionLocker

transaction.go:1446–1452  ·  view source on GitHub ↗
(ctx context.Context, locker *redlock.MultiLocker)

Source from the content-addressed store, hash-verified

1444}
1445
1446func (l *LedgerForge) acquireTransactionLocker(ctx context.Context, locker *redlock.MultiLocker) error {
1447 lockCfg := l.Config().Transaction
1448 if lockCfg.LockWaitTimeout > 0 {
1449 return locker.WaitLock(ctx, lockCfg.LockDuration, lockCfg.LockWaitTimeout)
1450 }
1451 return locker.Lock(ctx, lockCfg.LockDuration)
1452}
1453
1454func (l *LedgerForge) loadBalancesForQueuedBatch(ctx context.Context, balanceIDs []string) (map[string]*model.Balance, []*model.Balance, error) {
1455 balancesByID := make(map[string]*model.Balance, len(balanceIDs))

Callers 3

acquireLockMethod · 0.95
acquireBalanceSetLockMethod · 0.95

Calls 3

ConfigMethod · 0.95
WaitLockMethod · 0.45
LockMethod · 0.45

Tested by 1