Skip to content

Commit 39dfca3

Browse files
committed
feat: enable debug mode and update tests accordingly
- Add `WithDebug` function to enable debug mode in options - Use `WithDebug` in `TestRedisDefaultFlow` test function Signed-off-by: appleboy <[email protected]>
1 parent 6560f6a commit 39dfca3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

options.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ func WithLogger(l queue.Logger) Option {
140140
}
141141
}
142142

143+
// WithDebug set debug mode
144+
func WithDebug() Option {
145+
return func(w *options) {
146+
w.debug = true
147+
}
148+
}
149+
143150
func newOptions(opts ...Option) options {
144151
defaultOpts := options{
145152
addr: "127.0.0.1:6379",

redis_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func TestRedisDefaultFlow(t *testing.T) {
7373
w := NewWorker(
7474
WithConnectionString(endpoint),
7575
WithChannel("test"),
76+
WithDebug(),
7677
)
7778
q, err := queue.NewQueue(
7879
queue.WithWorker(w),

0 commit comments

Comments
 (0)