(ctx context.Context, balanceIDs []string)
| 1428 | } |
| 1429 | |
| 1430 | func (l *LedgerForge) acquireBalanceSetLock(ctx context.Context, balanceIDs []string) (*redlock.MultiLocker, error) { |
| 1431 | ctx, span := tracer.Start(ctx, "Acquiring Balance Set Lock") |
| 1432 | defer span.End() |
| 1433 | |
| 1434 | locker := redlock.NewMultiLocker(l.redis, balanceIDs, model.GenerateUUIDWithSuffix("loc")) |
| 1435 | if err := l.acquireTransactionLocker(ctx, locker); err != nil { |
| 1436 | span.RecordError(err) |
| 1437 | return nil, err |
| 1438 | } |
| 1439 | |
| 1440 | span.AddEvent("Locks acquired", trace.WithAttributes( |
| 1441 | attribute.StringSlice("locked.keys", locker.Keys()), |
| 1442 | )) |
| 1443 | return locker, nil |
| 1444 | } |
| 1445 | |
| 1446 | func (l *LedgerForge) acquireTransactionLocker(ctx context.Context, locker *redlock.MultiLocker) error { |
| 1447 | lockCfg := l.Config().Transaction |
no test coverage detected