Don't forget to lycansubscribe 🐺
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

share pds host cache between the workers

Kuba Suder 6a2a9718 b57206e0

+16 -3
+3 -3
app/post_downloader.rb
··· 3 3 4 4 require_relative 'models/post' 5 5 require_relative 'models/user' 6 + require_relative 'user_pds_cache' 6 7 7 8 class PostDownloader 8 9 attr_accessor :report, :name 9 10 10 11 def initialize 11 - @pds_cache = {} 12 12 @name = :downloader 13 13 end 14 14 ··· 51 51 end 52 52 53 53 def fetch_post_record(did, rkey) 54 - @pds_cache[did] ||= DID.new(did).document.pds_host 54 + UserPDSCache[did] ||= DID.new(did).document.pds_host 55 55 56 - pds = @pds_cache[did] 56 + pds = UserPDSCache[did] 57 57 sky = Minisky.new(pds, nil) 58 58 59 59 sky.get_request('com.atproto.repo.getRecord', { repo: did, collection: 'app.bsky.feed.post', rkey: rkey })
+13
app/user_pds_cache.rb
··· 1 + class UserPDSCache 2 + class << self 3 + def [](did) 4 + @pds_cache ||= {} 5 + @pds_cache[did] 6 + end 7 + 8 + def []=(did, pds) 9 + @pds_cache ||= {} 10 + @pds_cache[did] = pds 11 + end 12 + end 13 + end