From 53ede6765a1583538b2abc3142d858464b3cf01c Mon Sep 17 00:00:00 2001 From: Guillermo Serrahima Date: Thu, 16 Jul 2026 02:38:46 +0200 Subject: Implement fetched posts count tracking for catching gaps in cached posts --- fetchers/jetstream.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'fetchers/jetstream.go') diff --git a/fetchers/jetstream.go b/fetchers/jetstream.go index 866533a..b73137e 100644 --- a/fetchers/jetstream.go +++ b/fetchers/jetstream.go @@ -98,6 +98,7 @@ func handleJetstreamPost(conf *Config, did, uri string, commit *jetstreamCommit) if commit.Operation == "delete" { if _, found := conf.Cache.Get(uri); found { conf.Cache.Delete(uri) + conf.Cache.AddPostCount(did, -1) } return } @@ -113,6 +114,11 @@ func handleJetstreamPost(conf *Config, did, uri string, commit *jetstreamCommit) // cache the result if _, err := parseAppBskyFeedPostRecord(rawRecord, author, conf); err != nil { conf.Logger.Warn("jetstream: failed to parse post", "uri", uri, "error", err) + return + } + + if commit.Operation == "create" { + conf.Cache.AddPostCount(did, 1) } } -- cgit v1.2.3