twitterchiver/related_fetcher: mark tweets as media-fetched if they have no media

This commit is contained in:
Luke Granger-Brown 2020-10-18 21:12:37 +01:00
parent be71055ea1
commit 297fc79db0

View file

@ -139,6 +139,9 @@ func mediaFetchTick(ctx context.Context, cfg WorkerConfig) error {
// Abbreviated message for tweets with no media, which is the majority of them.
if len(t.ExtendedEntities.Media) == 0 {
if _, err := cfg.DatabasePool.Exec(ctx, "UPDATE tweets SET fetched_media=true WHERE id=$1", t.ID); err != nil {
log.Printf("[%v:%d] Failed to update tweets table: %v", cfg.Name, t.ID, err)
}
log.Printf("[%v:%d] No media", cfg.Name, t.ID)
return
}