mirror of
https://github.com/hibiken/asynq.git
synced 2025-10-20 09:16:12 +08:00
Update test to match the new API
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
package asynqtest
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"math"
|
||||
"sort"
|
||||
"testing"
|
||||
@@ -111,6 +112,15 @@ func NewTaskMessageWithQueue(taskType string, payload []byte, qname string) *bas
|
||||
}
|
||||
}
|
||||
|
||||
// KV serializes the given key-value pairs into stream of bytes.
|
||||
func KV(kv map[string]interface{}) []byte {
|
||||
b, err := json.Marshal(kv)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// TaskMessageAfterRetry returns an updated copy of t after retry.
|
||||
// It increments retry count and sets the error message.
|
||||
func TaskMessageAfterRetry(t base.TaskMessage, errMsg string) *base.TaskMessage {
|
||||
|
Reference in New Issue
Block a user