2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-11-10 11:31:58 +08:00

Fix dash command flags

This commit is contained in:
Ken Hibino 2022-06-22 20:57:11 -07:00 committed by GitHub
parent d0209d9273
commit a04ba6411d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -39,6 +39,7 @@ var dashCmd = &cobra.Command{
} }
dash.Run(dash.Options{ dash.Run(dash.Options{
PollInterval: flagPollInterval, PollInterval: flagPollInterval,
RedisConnOpt: getRedisConnOpt(),
}) })
}, },
} }

View File

@ -91,6 +91,7 @@ func (s *State) DebugString() string {
type Options struct { type Options struct {
DebugMode bool DebugMode bool
PollInterval time.Duration PollInterval time.Duration
RedisConnOpt asynq.RedisConnOpt
} }
func Run(opts Options) { func Run(opts Options) {
@ -108,7 +109,7 @@ func Run(opts Options) {
var ( var (
state = State{} // confined in this goroutine only; DO NOT SHARE state = State{} // confined in this goroutine only; DO NOT SHARE
inspector = asynq.NewInspector(asynq.RedisClientOpt{Addr: ":6379"}) inspector = asynq.NewInspector(opts.RedisConnOpt)
ticker = time.NewTicker(opts.PollInterval) ticker = time.NewTicker(opts.PollInterval)
eventCh = make(chan tcell.Event) eventCh = make(chan tcell.Event)