diff options
Diffstat (limited to 'fetchers/jetstream.go')
| -rw-r--r-- | fetchers/jetstream.go | 6 |
1 files changed, 6 insertions, 0 deletions
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) } } |
