Skip to content

Commit

Permalink
Read the length of pending records while locked (#10663)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor authored Sep 18, 2023
1 parent 738944b commit b4b6853
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 b4b6853

Please sign in to comment.