Handle Twitter duplicates (#20)
This commit adds a hash attribute to help identify duplicate messages. Tweets have a TweetID attribute for the initial thread identifier and a LastTweetID attribute to keep track of the last reply to eventually continue the thread if a duplicate is detected. Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
9629483953
commit
1f5cef17d2
6 changed files with 166 additions and 34 deletions
3
main.go
3
main.go
|
@ -132,8 +132,9 @@ func main() {
|
|||
log.Debugf("found old product: %s", p.Name)
|
||||
if trx = db.Unscoped().Delete(&p); trx.Error != nil {
|
||||
log.Warnf("cannot remove stale product %s (%s): %s", p.Name, p.URL, trx.Error)
|
||||
} else {
|
||||
log.Logf("stale product %s (%s) removed from database", p.Name, p.URL)
|
||||
}
|
||||
log.Printf("stale product %s (%s) removed from database", p.Name, p.URL)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue