Skip to content

Commit

Permalink
Tweak waiting for locks for contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Sep 19, 2023
1 parent 2afbfa3 commit 66fda6d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ func StartFlow(ctx context.Context, rt *runtime.Runtime, oa *models.OrgAssets, f
start := time.Now()

for len(remaining) > 0 && time.Since(start) < time.Minute*5 {
if ctx.Err() != nil {
return sessions, ctx.Err()
}

ss, skipped, err := tryToStartWithLock(ctx, rt, oa, flow, remaining, options)
if err != nil {
return nil, err
Expand All @@ -251,6 +255,10 @@ func StartFlow(ctx context.Context, rt *runtime.Runtime, oa *models.OrgAssets, f
remaining = skipped // skipped are now our remaining
}

if len(remaining) > 0 {
logrus.WithField("contacts", remaining).Warn("failed to acquire locks for contacts")
}

return sessions, nil
}

Expand Down

0 comments on commit 66fda6d

Please sign in to comment.