mirror of
https://github.com/hibiken/asynq.git
synced 2025-10-24 10:36:12 +08:00
chore(): 设置jobId 为cmdb的instanceId
This commit is contained in:
@@ -40,12 +40,12 @@ func TestServer(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
_, err = c.Enqueue(NewTask("send_email", asynqtest.JSON(map[string]interface{}{"recipient_id": 123})))
|
||||
_, err = c.Enqueue(NewTask("send_email", "", asynqtest.JSON(map[string]interface{}{"recipient_id": 123})))
|
||||
if err != nil {
|
||||
t.Errorf("could not enqueue a task: %v", err)
|
||||
}
|
||||
|
||||
_, err = c.Enqueue(NewTask("send_email", asynqtest.JSON(map[string]interface{}{"recipient_id": 456})), ProcessIn(1*time.Hour))
|
||||
_, err = c.Enqueue(NewTask("send_email", "", asynqtest.JSON(map[string]interface{}{"recipient_id": 456})), ProcessIn(1*time.Hour))
|
||||
if err != nil {
|
||||
t.Errorf("could not enqueue a task: %v", err)
|
||||
}
|
||||
@@ -183,15 +183,15 @@ func TestServerWithFlakyBroker(t *testing.T) {
|
||||
}
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
_, err := c.Enqueue(NewTask("enqueued", nil), MaxRetry(i))
|
||||
_, err := c.Enqueue(NewTask("enqueued", "", nil), MaxRetry(i))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_, err = c.Enqueue(NewTask("bad_task", nil))
|
||||
_, err = c.Enqueue(NewTask("bad_task", "", nil))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_, err = c.Enqueue(NewTask("scheduled", nil), ProcessIn(time.Duration(i)*time.Second))
|
||||
_, err = c.Enqueue(NewTask("scheduled", "", nil), ProcessIn(time.Duration(i)*time.Second))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user