From 297fc79db0e78c4168eaba72ba970cf4e438128b Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 18 Oct 2020 21:12:37 +0100 Subject: [PATCH] twitterchiver/related_fetcher: mark tweets as media-fetched if they have no media --- go/twitterchiver/related_fetcher/fetcher.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/twitterchiver/related_fetcher/fetcher.go b/go/twitterchiver/related_fetcher/fetcher.go index fc5f55d7f1..5fc8a9ee25 100644 --- a/go/twitterchiver/related_fetcher/fetcher.go +++ b/go/twitterchiver/related_fetcher/fetcher.go @@ -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 }