Skip to content

Commit 0340628

Browse files
committed
fix: improve retry logic and update test cases
- Change condition in queue.go to check if `m.RetryDelay` is equal to 0 - Remove `RetryDelay` value from ring_test.go Signed-off-by: appleboy <[email protected]>
1 parent 2c7862e commit 0340628

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

queue.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func (q *Queue) handle(m *job.Message) error {
220220
}
221221
m.RetryCount--
222222

223-
if m.RetryDelay != 0 {
223+
if m.RetryDelay == 0 {
224224
delay = b.Duration()
225225
}
226226

ring_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@ func TestRetryCountWithNewTask(t *testing.T) {
407407
},
408408
job.AllowOption{
409409
RetryCount: job.Int64(3),
410-
RetryDelay: job.Time(50 * time.Millisecond),
411410
},
412411
))
413412
assert.Len(t, messages, 0)

0 commit comments

Comments
 (0)