Skip to content

Commit

Permalink
Read the length of pending records while locked (#10661)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor authored Sep 15, 2023
1 parent a97547d commit 05f9558
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@ func (u *upkeepStateStore) Start(pctx context.Context) error {
}

func (u *upkeepStateStore) flush(ctx context.Context) {
cloneRecords := make([]persistedStateRecord, len(u.pendingRecords))

u.mu.Lock()
cloneRecords := make([]persistedStateRecord, len(u.pendingRecords))
copy(cloneRecords, u.pendingRecords)
u.pendingRecords = []persistedStateRecord{}
u.mu.Unlock()
Expand Down

0 comments on commit 05f9558

Please sign in to comment.