Page MenuHomePhabricator

[keyserver][lib] replace neynar client cache with redis cache
ClosedPublic

Authored by varun on Oct 8 2024, 1:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 3:55 AM
Unknown Object (File)
Sat, Nov 9, 2:21 AM
Unknown Object (File)
Thu, Oct 31, 10:49 PM
Unknown Object (File)
Wed, Oct 30, 4:22 AM
Unknown Object (File)
Wed, Oct 23, 8:43 PM
Unknown Object (File)
Oct 19 2024, 4:43 AM
Unknown Object (File)
Oct 18 2024, 6:24 PM
Unknown Object (File)
Oct 18 2024, 6:24 PM
Subscribers

Details

Summary

we're using redis because we have multiple keyserver nodes that will need access to this data in order to minimize the number of neynar client calls

instead of caching led channels by the lead user, we cache all channels we get from the fetchFollowed neynar client method by channel ID. we do this in the background since we don't need to block on this operation.

Depends on D13636

Test Plan

tested this in a few different ways:

  1. commented out the background operation that sets data in the cache. registered a user with j4ck.eth's fid and confirmed that user was made lead of bromero community, which they lead on farcaster
  2. uncommented the background operation. deleted and registered j4ck.eth again and confirmed that the information was fetched from the cache using redis-cli monitor. once again, user was made lead of bromero community

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Oct 8 2024, 1:44 PM
ashoat added inline comments.
keyserver/src/updaters/thread-updaters.js
976 ↗(On Diff #44976)

We need to wrap this in ignorePromiseRejections, or else rejections will cause the Node.js process to crash and restart

This revision is now accepted and ready to land.Oct 8 2024, 6:47 PM