aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/indexer/stats/db.go4
-rw-r--r--modules/queue/queue_redis.go2
-rw-r--r--modules/queue/unique_queue_redis.go4
3 files changed, 8 insertions, 2 deletions
diff --git a/modules/indexer/stats/db.go b/modules/indexer/stats/db.go
index fe219b443f..6e10ee2052 100644
--- a/modules/indexer/stats/db.go
+++ b/modules/indexer/stats/db.go
@@ -19,6 +19,10 @@ func (db *DBIndexer) Index(id int64) error {
if err != nil {
return err
}
+ if repo.IsEmpty {
+ return nil
+ }
+
status, err := repo.GetIndexerStatus(models.RepoIndexerTypeStats)
if err != nil {
return err
diff --git a/modules/queue/queue_redis.go b/modules/queue/queue_redis.go
index 8a395cd5aa..4e05ddd17e 100644
--- a/modules/queue/queue_redis.go
+++ b/modules/queue/queue_redis.go
@@ -121,7 +121,7 @@ func (fifo *RedisByteFIFO) PushFunc(data []byte, fn func() error) error {
// Pop pops data from the start of the fifo
func (fifo *RedisByteFIFO) Pop() ([]byte, error) {
data, err := fifo.client.LPop(fifo.queueName).Bytes()
- if err != nil && err == redis.Nil {
+ if err == nil || err == redis.Nil {
return data, nil
}
return data, err
diff --git a/modules/queue/unique_queue_redis.go b/modules/queue/unique_queue_redis.go
index e5b2c48dbb..9404369075 100644
--- a/modules/queue/unique_queue_redis.go
+++ b/modules/queue/unique_queue_redis.go
@@ -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
}