Fix queue pop error and stat empty repository error (#10248)

* Fix queue pop error and stat empty repository error

* Fix error
This commit is contained in:
Lunny Xiao 2020-02-12 18:12:27 +08:00 committed by GitHub
parent 83a8944fcf
commit 3d69bbd58f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -4,6 +4,8 @@
package queue
import "github.com/go-redis/redis"
// RedisUniqueQueueType is the type for redis queue
const RedisUniqueQueueType Type = "unique-redis"
@ -102,7 +104,7 @@ func (fifo *RedisUniqueByteFIFO) PushFunc(data []byte, fn func() error) error {
// Pop pops data from the start of the fifo
func (fifo *RedisUniqueByteFIFO) Pop() ([]byte, error) {
data, err := fifo.client.LPop(fifo.queueName).Bytes()
if err != nil {
if err != nil && err != redis.Nil {
return data, err
}