Skip to content

Commit

Permalink
feat: enable debug mode and update tests accordingly
Browse files Browse the repository at this point in the history
- Add `WithDebug` function to enable debug mode in options
- Use `WithDebug` in `TestRedisDefaultFlow` test function

Signed-off-by: appleboy <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Jan 18, 2025
1 parent 6560f6a commit 39dfca3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ func WithLogger(l queue.Logger) Option {
}
}

// WithDebug set debug mode
func WithDebug() Option {
return func(w *options) {
w.debug = true
}
}

func newOptions(opts ...Option) options {
defaultOpts := options{
addr: "127.0.0.1:6379",
Expand Down
1 change: 1 addition & 0 deletions redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func TestRedisDefaultFlow(t *testing.T) {
w := NewWorker(
WithConnectionString(endpoint),
WithChannel("test"),
WithDebug(),
)
q, err := queue.NewQueue(
queue.WithWorker(w),
Expand Down

0 comments on commit 39dfca3

Please sign in to comment.