diff --git a/main.go b/main.go index c710c3e..ba3953c 100644 --- a/main.go +++ b/main.go @@ -182,10 +182,16 @@ func (that *ProjectBackfeedManager) Do() { sAddItems = append(sAddItems, items[i]) } } - if len(sAddItems) == 0 { - continue + dupes := wrapped - len(sAddItems) + if len(sAddItems) != 0 { + err := that.ProjectRedis.SAdd(context.Background(), fmt.Sprintf("%s:todo:backfeed", that.Name), sAddItems...).Err() + if err != nil { + log.Printf("failed to sadd items for %s: %s", that.Name, err) + } + } + if dupes > 0 { + that.BackfeedRedis.HIncrBy(context.Background(), ":", that.Name, int64(dupes)) } - that.ProjectRedis.SAdd(context.Background(), fmt.Sprintf("%s:todo:backfeed", that.Name), sAddItems...) } }