Skip to content

Commit 655c933

Browse files
authored
fixed redis timeout issue (#15)
1 parent ea795f4 commit 655c933

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

redis.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import (
1616

1717
var _ core.Worker = (*Worker)(nil)
1818

19+
const blockTime = 60000
20+
1921
// Worker for Redis
2022
type Worker struct {
2123
// redis config
@@ -101,10 +103,11 @@ func (w *Worker) fetchTask() {
101103
Count: 1,
102104
// we use the block command to make sure if no entry is found we wait
103105
// until an entry is found
104-
Block: 0,
106+
Block: blockTime,
105107
}).Result()
106108
if err != nil {
107-
return
109+
w.opts.logger.Errorf("error while reading from redis %v",err)
110+
continue
108111
}
109112
// we have received the data we should loop it and queue the messages
110113
// so that our tasks can start processing

0 commit comments

Comments
 (0)