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
F3513787: D13637.diff
Sun, Dec 22, 2:05 AM
Unknown Object (File)
Sun, Dec 15, 6:52 AM
Unknown Object (File)
Wed, Nov 27, 11:23 PM
Unknown Object (File)
Tue, Nov 26, 11:23 AM
Unknown Object (File)
Nov 9 2024, 3:55 AM
Unknown Object (File)
Nov 9 2024, 2:21 AM
Unknown Object (File)
Oct 31 2024, 10:49 PM
Unknown Object (File)
Oct 30 2024, 4:22 AM
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