2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-08-19 15:08:55 +08:00

Allow upper case characters in queue name

This commit is contained in:
Ken Hibino
2021-07-15 06:12:13 -07:00
parent c0ae62499f
commit 46b23d6495
5 changed files with 18 additions and 13 deletions

View File

@@ -10,6 +10,7 @@ import (
"crypto/md5"
"encoding/hex"
"fmt"
"strings"
"sync"
"time"
@@ -85,7 +86,7 @@ func TaskStateFromString(s string) (TaskState, error) {
// ValidateQueueName validates a given qname to be used as a queue name.
// Returns nil if valid, otherwise returns non-nil error.
func ValidateQueueName(qname string) error {
if len(qname) == 0 {
if len(strings.TrimSpace(qname)) == 0 {
return fmt.Errorf("queue name must contain one or more characters")
}
return nil