fix: [inputreader] remove retry from reader

master v0.1.5
Jean-Louis Huynen 2020-05-27 16:52:19 +02:00
parent 42a8154142
commit e6e4a49f13
No known key found for this signature in database
GPG Key ID: 64799157F4BD6B93
1 changed files with 5 additions and 10 deletions

View File

@ -2,10 +2,8 @@ package inputreader
import ( import (
"bytes" "bytes"
"io"
"time"
"github.com/gomodule/redigo/redis" "github.com/gomodule/redigo/redis"
"io"
) )
// RedisLPOPReader is a abstraction of LPOP list // RedisLPOPReader is a abstraction of LPOP list
@ -17,14 +15,12 @@ type RedisLPOPReader struct {
d int d int
// D4 Queue storing // D4 Queue storing
q string q string
// Time in minute before retrying
retryPeriod time.Duration
// Current buffer // Current buffer
buf []byte buf []byte
} }
// NewLPOPReader creates a new RedisLPOPReader // NewLPOPReader creates a new RedisLPOPReader
func NewLPOPReader(rc *redis.Conn, db int, queue string, rt int) (*RedisLPOPReader, error) { func NewLPOPReader(rc *redis.Conn, db int, queue string) (*RedisLPOPReader, error) {
rr := *rc rr := *rc
if _, err := rr.Do("SELECT", db); err != nil { if _, err := rr.Do("SELECT", db); err != nil {
@ -33,10 +29,9 @@ func NewLPOPReader(rc *redis.Conn, db int, queue string, rt int) (*RedisLPOPRead
} }
r := &RedisLPOPReader{ r := &RedisLPOPReader{
r: rc, r: rc,
d: db, d: db,
q: queue, q: queue,
retryPeriod: time.Duration(rt) * time.Minute,
} }
return r, nil return r, nil