Template of a custom feed generator service for the Bluesky network in Ruby

faster checking of existing posts in rebuild

Changed files
+3 -1
lib
tasks
+3 -1
lib/tasks/feeds.rake
··· 9 9 require 'base64' 10 10 require 'json' 11 11 require 'open-uri' 12 + require 'set' 12 13 13 14 14 15 def get_feed ··· 169 170 total = start ? (stop.id - start.id + 1) : (stop.id - first.id + 1) 170 171 171 172 if append_only 172 - current_post_ids = FeedPost.where(feed_id: feed.feed_id).pluck('post_id') 173 + feed_posts = FeedPost.where(feed_id: feed.feed_id) 174 + current_post_ids = Set.new(feed_posts.pluck('post_id')) 173 175 elsif !dry 174 176 print "This will erase and replace the contents of the feed. Continue? [y/n]: " 175 177 answer = STDIN.readline