Skip to content

Commit

Permalink
Fix async_op test regarding stop() behavior
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Sabsay <[email protected]>
  • Loading branch information
Daniel Sabsay committed Jan 7, 2025
1 parent ffd4f9c commit 8f9b5f5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/cacheutil/async_op.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ func (p *AsyncOperationProcessor) asyncQueueProcessLoop() {
case op := <-p.asyncQueue:
op()
case <-p.stop:
return
// Run all remaining operations before stopping
select {
case op := <-p.asyncQueue:
op()
continue
default:
return
}
}
}
}
Expand Down

0 comments on commit 8f9b5f5

Please sign in to comment.