Browse Source

stats for dupes

backfeed-full-error
Fusl 2 years ago
parent
commit
fa467be11c
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      main.go

+ 9
- 3
main.go View File

@@ -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...)
}
}



Loading…
Cancel
Save