Page MenuHomePhabricator

[lib] add new cache for fc channel info
ClosedPublic

Authored by varun on Oct 17 2024, 5:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 1:05 PM
Unknown Object (File)
Wed, Nov 20, 8:17 AM
Unknown Object (File)
Wed, Nov 20, 8:16 AM
Unknown Object (File)
Wed, Nov 20, 8:16 AM
Unknown Object (File)
Sun, Nov 10, 10:18 AM
Unknown Object (File)
Wed, Nov 6, 2:48 PM
Unknown Object (File)
Sat, Nov 2, 2:52 PM
Unknown Object (File)
Fri, Nov 1, 9:11 PM
Subscribers

Details

Summary

we will use this cache to fetch farcaster channel image URLs (and later, descriptions)

this is modeled after the fc cache for users

Test Plan

tested at end of stack, made sure that we're only calling neynar API once per channel ID

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun held this revision as a draft.
varun published this revision for review.Oct 17 2024, 8:52 PM
ashoat requested changes to this revision.Oct 20 2024, 11:19 AM
ashoat added inline comments.
lib/utils/fc-cache.js
183 ↗(On Diff #45250)

You're diverging from the approach of getFarcasterUsersForFIDs, perhaps intentionally. But if you are returning in the case of a timeout, then the ternary expression on line 186 doesn't make sense.

If you want to cache failed query results (eg. as a result of a timeout) then I think you'll need to change this line. If you don't want to cache them, then I think you can just use cacheTimeout in all cases.

This revision now requires changes to proceed.Oct 20 2024, 11:19 AM
This revision is now accepted and ready to land.Oct 22 2024, 1:29 PM
This revision was automatically updated to reflect the committed changes.