Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: defer
Signed-off-by: Bo-Yi Wu <[email protected]>
  • Loading branch information
appleboy committed May 29, 2022
commit cf6a656fbce967d12ff29aed2a0e18b60ef91e5d
4 changes: 2 additions & 2 deletions queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func TestCloseQueueAfterShutdown(t *testing.T) {

func BenchmarkQueueTask(b *testing.B) {
q := NewPool(5)
q.Release()
defer q.Release()
for n := 0; n < b.N; n++ {
_ = q.QueueTask(func(context.Context) error {
time.Sleep(10 * time.Millisecond)
Expand All @@ -158,7 +158,7 @@ func BenchmarkQueue(b *testing.B) {
message: "foo",
}
q := NewPool(5)
q.Release()
defer q.Release()
for n := 0; n < b.N; n++ {
_ = q.Queue(m)
}
Expand Down