0-5788719150923125 / vtx

an experiment
Other
7 stars 1 forks source link

Fix Reddit cache handling #13

Closed Vectorrent closed 3 months ago

Vectorrent commented 11 months ago

Currently, Reddit posts are created when the bot queries Reddit, to check if the post has already been published. This is error prone, because Reddit rate limits cause a lot of cache misses, and empty responses. Thus, the bot ends up creating duplicate posts.

We need to save published submission state locally.

Vectorrent commented 3 months ago

This was addressed previously. I implemented TinyDB, which keeps a small JSON file saved on-disk. We sync with that file now, rather than relying on Reddit APIs for cache resolution.