@@ -13,15 +13,15 @@ import (
13
13
func TestEngine_Publish (t * testing.T ) {
14
14
e := NewEngine (OldRedisEngine , NewRedisEngine )
15
15
body := []byte ("hello msg 1" )
16
- j := engine .NewJob ("ns-engine" , "q1" , body , 10 , 2 , 1 , "" )
16
+ j := engine .NewJob ("ns-engine" , "q1" , body , nil , 10 , 2 , 1 , "" )
17
17
jobID , err := e .Publish (j )
18
18
t .Log (jobID )
19
19
if err != nil {
20
20
t .Fatalf ("Failed to publish: %s" , err )
21
21
}
22
22
23
23
// Publish no-delay job
24
- j = engine .NewJob ("ns-engine" , "q1" , body , 10 , 0 , 1 , "" )
24
+ j = engine .NewJob ("ns-engine" , "q1" , body , nil , 10 , 0 , 1 , "" )
25
25
jobID , err = e .Publish (j )
26
26
t .Log (jobID )
27
27
if err != nil {
@@ -37,7 +37,7 @@ func TestEngine_Publish(t *testing.T) {
37
37
func TestEngine_Consume (t * testing.T ) {
38
38
e := NewEngine (OldRedisEngine , NewRedisEngine )
39
39
body := []byte ("hello msg 2" )
40
- j := engine .NewJob ("ns-engine" , "q2" , body , 10 , 2 , 1 , "" )
40
+ j := engine .NewJob ("ns-engine" , "q2" , body , nil , 10 , 2 , 1 , "" )
41
41
jobID , err := e .Publish (j )
42
42
t .Log (jobID )
43
43
if err != nil {
@@ -53,7 +53,7 @@ func TestEngine_Consume(t *testing.T) {
53
53
}
54
54
55
55
// Consume job that's published in no-delay way
56
- j = engine .NewJob ("ns-engine" , "q2" , body , 10 , 0 , 1 , "" )
56
+ j = engine .NewJob ("ns-engine" , "q2" , body , nil , 10 , 0 , 1 , "" )
57
57
jobID , err = e .Publish (j )
58
58
t .Log (jobID )
59
59
if err != nil {
@@ -72,9 +72,9 @@ func TestEngine_Consume(t *testing.T) {
72
72
func TestEngine_Consume2 (t * testing.T ) {
73
73
e := NewEngine (OldRedisEngine , NewRedisEngine )
74
74
body := []byte ("hello msg 3" )
75
- j1 := engine .NewJob ("ns-engine" , "q3" , []byte ("delay msg" ), 10 , 5 , 1 , "" )
75
+ j1 := engine .NewJob ("ns-engine" , "q3" , []byte ("delay msg" ), nil , 10 , 5 , 1 , "" )
76
76
_ , err := e .Publish (j1 )
77
- j2 := engine .NewJob ("ns-engine" , "q3" , body , 10 , 2 , 1 , "" )
77
+ j2 := engine .NewJob ("ns-engine" , "q3" , body , nil , 10 , 2 , 1 , "" )
78
78
jobID , err := e .Publish (j2 )
79
79
if err != nil {
80
80
t .Fatalf ("Failed to publish: %s" , err )
@@ -91,12 +91,12 @@ func TestEngine_Consume2(t *testing.T) {
91
91
func TestEngine_ConsumeMulti (t * testing.T ) {
92
92
e := NewEngine (OldRedisEngine , NewRedisEngine )
93
93
body := []byte ("hello msg 4" )
94
- j1 := engine .NewJob ("ns-engine" , "q4" , body , 10 , 3 , 1 , "" )
94
+ j1 := engine .NewJob ("ns-engine" , "q4" , body , nil , 10 , 3 , 1 , "" )
95
95
jobID , err := e .Publish (j1 )
96
96
if err != nil {
97
97
t .Fatalf ("Failed to publish: %s" , err )
98
98
}
99
- j2 := engine .NewJob ("ns-engine" , "q5" , body , 10 , 1 , 1 , "" )
99
+ j2 := engine .NewJob ("ns-engine" , "q5" , body , nil , 10 , 1 , 1 , "" )
100
100
jobID2 , err := e .Publish (j2 )
101
101
if err != nil {
102
102
t .Fatalf ("Failed to publish: %s" , err )
@@ -122,7 +122,7 @@ func TestEngine_ConsumeMulti(t *testing.T) {
122
122
func TestEngine_Peek (t * testing.T ) {
123
123
e := NewEngine (OldRedisEngine , NewRedisEngine )
124
124
body := []byte ("hello msg 6" )
125
- j := engine .NewJob ("ns-engine" , "q6" , body , 10 , 0 , 1 , "" )
125
+ j := engine .NewJob ("ns-engine" , "q6" , body , nil , 10 , 0 , 1 , "" )
126
126
jobID , err := e .Publish (j )
127
127
if err != nil {
128
128
t .Fatalf ("Failed to publish: %s" , err )
@@ -136,7 +136,7 @@ func TestEngine_Peek(t *testing.T) {
136
136
func TestEngine_DrainOld (t * testing.T ) {
137
137
e := NewEngine (OldRedisEngine , NewRedisEngine )
138
138
body := []byte ("hello msg 7" )
139
- j := engine .NewJob ("ns-engine" , "q7" , body , 10 , 0 , 1 , "" )
139
+ j := engine .NewJob ("ns-engine" , "q7" , body , nil , 10 , 0 , 1 , "" )
140
140
jobID , err := OldRedisEngine .Publish (j )
141
141
job , err := e .Consume ("ns-engine" , []string {"q7" }, 5 , 0 )
142
142
if err != nil {
@@ -150,7 +150,7 @@ func TestEngine_DrainOld(t *testing.T) {
150
150
func TestEngine_BatchConsume (t * testing.T ) {
151
151
e := NewEngine (OldRedisEngine , NewRedisEngine )
152
152
body := []byte ("hello msg 8" )
153
- j := engine .NewJob ("ns-engine" , "q8" , body , 10 , 2 , 1 , "" )
153
+ j := engine .NewJob ("ns-engine" , "q8" , body , nil , 10 , 2 , 1 , "" )
154
154
jobID , err := e .Publish (j )
155
155
if err != nil {
156
156
t .Fatalf ("Failed to publish: %s" , err )
@@ -176,7 +176,7 @@ func TestEngine_BatchConsume(t *testing.T) {
176
176
// Consume some jobs
177
177
jobIDMap := map [string ]bool {}
178
178
for i := 0 ; i < 4 ; i ++ {
179
- j := engine .NewJob ("ns-engine" , "q8" , body , 10 , 0 , 1 , "" )
179
+ j := engine .NewJob ("ns-engine" , "q8" , body , nil , 10 , 0 , 1 , "" )
180
180
jobID , err := e .Publish (j )
181
181
t .Log (jobID )
182
182
if err != nil {
@@ -223,7 +223,7 @@ func TestEngine_BatchConsume(t *testing.T) {
223
223
func TestEngine_DeadLetter_Size (t * testing.T ) {
224
224
body := []byte ("hello msg 9" )
225
225
queues := []string {"q9" }
226
- j := engine .NewJob ("ns-engine" , "q9" , body , 10 , 0 , 1 , "" )
226
+ j := engine .NewJob ("ns-engine" , "q9" , body , nil , 10 , 0 , 1 , "" )
227
227
jobID , err := OldRedisEngine .Publish (j )
228
228
job , err := OldRedisEngine .Consume ("ns-engine" , queues , 0 , 0 )
229
229
if err != nil {
@@ -232,7 +232,7 @@ func TestEngine_DeadLetter_Size(t *testing.T) {
232
232
if job .ID () != jobID {
233
233
t .Fatal ("Mismatched job" )
234
234
}
235
- j = engine .NewJob ("ns-engine" , "q9" , body , 10 , 0 , 1 , "" )
235
+ j = engine .NewJob ("ns-engine" , "q9" , body , nil , 10 , 0 , 1 , "" )
236
236
jobID , err = NewRedisEngine .Publish (j )
237
237
job , err = NewRedisEngine .Consume ("ns-engine" , queues , 0 , 0 )
238
238
if job .ID () != jobID {
@@ -250,7 +250,7 @@ func TestEngine_PublishWithJobID(t *testing.T) {
250
250
e := NewEngine (OldRedisEngine , NewRedisEngine )
251
251
body := []byte ("hello msg 1" )
252
252
// Publish no-delay job
253
- j := engine .NewJob ("ns-engine" , "q10" , body , 10 , 0 , 1 , "jobID1" )
253
+ j := engine .NewJob ("ns-engine" , "q10" , body , nil , 10 , 0 , 1 , "jobID1" )
254
254
jobID , err := e .Publish (j )
255
255
t .Log (jobID )
256
256
assert .Nil (t , err )
0 commit comments