@@ -104,7 +104,7 @@ func TestJobReachTimeout(t *testing.T) {
104
104
WithWorkerCount (2 ),
105
105
)
106
106
assert .NoError (t , err )
107
- assert .NoError (t , q .Queue (m , job .WithTimeout (30 * time .Millisecond )))
107
+ assert .NoError (t , q .Queue (m , job.AllowOption { Timeout : job . Time (30 * time .Millisecond )} ))
108
108
q .Start ()
109
109
time .Sleep (50 * time .Millisecond )
110
110
q .Release ()
@@ -138,8 +138,8 @@ func TestCancelJobAfterShutdown(t *testing.T) {
138
138
WithWorkerCount (2 ),
139
139
)
140
140
assert .NoError (t , err )
141
- assert .NoError (t , q .Queue (m , job .WithTimeout (100 * time .Millisecond )))
142
- assert .NoError (t , q .Queue (m , job .WithTimeout (100 * time .Millisecond )))
141
+ assert .NoError (t , q .Queue (m , job.AllowOption { Timeout : job . Time (100 * time .Millisecond )} ))
142
+ assert .NoError (t , q .Queue (m , job.AllowOption { Timeout : job . Time (100 * time .Millisecond )} ))
143
143
q .Start ()
144
144
time .Sleep (10 * time .Millisecond )
145
145
assert .Equal (t , 2 , int (q .metric .busyWorkers ))
@@ -367,8 +367,10 @@ func TestRetryCountWithNewMessage(t *testing.T) {
367
367
368
368
assert .NoError (t , q .Queue (
369
369
m ,
370
- job .WithRetryCount (3 ),
371
- job .WithRetryDelay (50 * time .Millisecond ),
370
+ job.AllowOption {
371
+ RetryCount : job .Int64 (3 ),
372
+ RetryDelay : job .Time (50 * time .Millisecond ),
373
+ },
372
374
))
373
375
assert .Len (t , messages , 0 )
374
376
q .Start ()
@@ -403,8 +405,10 @@ func TestRetryCountWithNewTask(t *testing.T) {
403
405
messages <- "foobar"
404
406
return nil
405
407
},
406
- job .WithRetryCount (3 ),
407
- job .WithRetryDelay (50 * time .Millisecond ),
408
+ job.AllowOption {
409
+ RetryCount : job .Int64 (3 ),
410
+ RetryDelay : job .Time (50 * time .Millisecond ),
411
+ },
408
412
))
409
413
assert .Len (t , messages , 0 )
410
414
q .Start ()
@@ -437,8 +441,10 @@ func TestCancelRetryCountWithNewTask(t *testing.T) {
437
441
messages <- "foobar"
438
442
return nil
439
443
},
440
- job .WithRetryCount (3 ),
441
- job .WithRetryDelay (100 * time .Millisecond ),
444
+ job.AllowOption {
445
+ RetryCount : job .Int64 (3 ),
446
+ RetryDelay : job .Time (100 * time .Millisecond ),
447
+ },
442
448
))
443
449
assert .Len (t , messages , 0 )
444
450
q .Start ()
@@ -478,8 +484,10 @@ func TestCancelRetryCountWithNewMessage(t *testing.T) {
478
484
479
485
assert .NoError (t , q .Queue (
480
486
m ,
481
- job .WithRetryCount (3 ),
482
- job .WithRetryDelay (100 * time .Millisecond ),
487
+ job.AllowOption {
488
+ RetryCount : job .Int64 (3 ),
489
+ RetryDelay : job .Time (100 * time .Millisecond ),
490
+ },
483
491
))
484
492
assert .Len (t , messages , 0 )
485
493
q .Start ()
0 commit comments