mirror of
https://github.com/hibiken/asynq.git
synced 2024-12-25 23:32:17 +08:00
Add String method to TaskState
This commit is contained in:
parent
385323b679
commit
08d8f0b37c
16
asynq.go
16
asynq.go
@ -123,6 +123,22 @@ const (
|
||||
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 represents a sum of following types:
|
||||
|
Loading…
Reference in New Issue
Block a user