2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-12-25 23:32:17 +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{
PollInterval: flagPollInterval,
RedisConnOpt: getRedisConnOpt(),
})
},
}

View File

@ -91,6 +91,7 @@ func (s *State) DebugString() string {
type Options struct {
DebugMode bool
PollInterval time.Duration
RedisConnOpt asynq.RedisConnOpt
}
func Run(opts Options) {
@ -108,7 +109,7 @@ func Run(opts Options) {
var (
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)
eventCh = make(chan tcell.Event)