twitterchiver/related_fetcher: mark tweets as media-fetched if they have no media
This commit is contained in:
parent
be71055ea1
commit
297fc79db0
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue