Skip to content

Commit

Permalink
Fix callback queue to maintain invariant with TryQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbeaumont committed Jun 15, 2021
1 parent 43c1f46 commit eacd1fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/callbackqueue/callbackqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ func (cq *CallbackQueue) TryQueue(id string, try func() error, callback func(con
// pop off last element
callbacks := cq.callbacks[id]
cq.callbacks[id] = callbacks[:len(callbacks)-1]
if len(cq.callbacks[id]) == 0 {
delete(cq.callbacks, id)
}

return err
}
Expand Down

0 comments on commit eacd1fa

Please sign in to comment.