mirror of
https://github.com/hibiken/asynq.git
synced 2025-04-22 16:50:18 +08:00
Add String method to TaskState
This commit is contained in:
parent
062f814c0c
commit
f76f45c350
16
asynq.go
16
asynq.go
@ -123,6 +123,22 @@ const (
|
|||||||
TaskStateArchived
|
TaskStateArchived
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (s TaskState) String() string {
|
||||||
|
switch s {
|
||||||
|
case TaskStateActive:
|
||||||
|
return "active"
|
||||||
|
case TaskStatePending:
|
||||||
|
return "pending"
|
||||||
|
case TaskStateScheduled:
|
||||||
|
return "scheduled"
|
||||||
|
case TaskStateRetry:
|
||||||
|
return "retry"
|
||||||
|
case TaskStateArchived:
|
||||||
|
return "archived"
|
||||||
|
}
|
||||||
|
panic("asynq: unknown task state")
|
||||||
|
}
|
||||||
|
|
||||||
// RedisConnOpt is a discriminated union of types that represent Redis connection configuration option.
|
// RedisConnOpt is a discriminated union of types that represent Redis connection configuration option.
|
||||||
//
|
//
|
||||||
// RedisConnOpt represents a sum of following types:
|
// RedisConnOpt represents a sum of following types:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user