Skip to content

Commit 7bbcc76

Browse files
committed
refactor: refactor job timeout handling in Queue method calls
- Refactor `Queue` method calls to use `job.AllowOption` with `Timeout` instead of `job.WithTimeout` Signed-off-by: appleboy <[email protected]>
1 parent 94f36c8 commit 7bbcc76

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

redis_test.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ func TestJobReachTimeout(t *testing.T) {
359359
assert.NoError(t, err)
360360
q.Start()
361361
time.Sleep(50 * time.Millisecond)
362-
assert.NoError(t, q.Queue(m, job.WithTimeout(20*time.Millisecond)))
362+
assert.NoError(t, q.Queue(m, job.AllowOption{
363+
Timeout: job.Time(20 * time.Millisecond),
364+
}))
363365
time.Sleep(2 * time.Second)
364366
q.Shutdown()
365367
q.Wait()
@@ -400,7 +402,9 @@ func TestCancelJobAfterShutdown(t *testing.T) {
400402
assert.NoError(t, err)
401403
q.Start()
402404
time.Sleep(50 * time.Millisecond)
403-
assert.NoError(t, q.Queue(m, job.WithTimeout(3*time.Second)))
405+
assert.NoError(t, q.Queue(m, job.AllowOption{
406+
Timeout: job.Time(3 * time.Second),
407+
}))
404408
time.Sleep(2 * time.Second)
405409
q.Shutdown()
406410
q.Wait()

0 commit comments

Comments
 (0)