From 50895e2aa32ef6c5dfbec10f25698ec483caa586 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 18 Oct 2020 21:02:17 +0100 Subject: [PATCH] twitterchiver/related_fetcher: fix marking tweets as done if they had no related content --- go/twitterchiver/related_fetcher/fetcher.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/go/twitterchiver/related_fetcher/fetcher.go b/go/twitterchiver/related_fetcher/fetcher.go index 1188159dd5..fc5f55d7f1 100644 --- a/go/twitterchiver/related_fetcher/fetcher.go +++ b/go/twitterchiver/related_fetcher/fetcher.go @@ -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 }