twitterchiver/related_fetcher: fix marking tweets as done if they had no related content

This commit is contained in:
Luke Granger-Brown 2020-10-18 21:02:17 +01:00
parent cc8f24e8e1
commit 50895e2aa3

View file

@ -273,6 +273,11 @@ func relatedFetchTick(ctx context.Context, cfg WorkerConfig) error {
log.Printf("[%v:%d] Got %d tweets to fetch (%v)", cfg.Name, t.ID, len(tweetIDsToFetch), tweetIDsToFetch)
if len(tweetIDsToFetch) == 0 {
if _, err := cfg.DatabasePool.Exec(ctx, "UPDATE tweets SET fetched_related_tweets=true WHERE id=$1", t.ID); err != nil {
log.Printf("[%v:%d] Updating tweet to mark as completed: %v", cfg.Name, t.ID, err)
} else {
log.Printf("[%v:%d] Successfully marked as done (no tweets to fetch).", cfg.Name, t.ID)
}
continue
}