Exit loop when context is cancelled

This commit is contained in:
Chris S. Kim 2022-08-25 11:25:59 -04:00 committed by Chris S. Kim
parent e14ab54131
commit 2e75833133
1 changed files with 6 additions and 0 deletions

View File

@ -391,6 +391,12 @@ func (s *Server) runPeeringDeletions(ctx context.Context) error {
// process. This includes deletion of the peerings themselves in addition to any peering data
raftLimiter := rate.NewLimiter(defaultDeletionApplyRate, int(defaultDeletionApplyRate))
for {
select {
case <-ctx.Done():
return nil
default:
}
ws := memdb.NewWatchSet()
state := s.fsm.State()
_, peerings, err := s.fsm.State().PeeringListDeleted(ws)