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

print duration of the cleanup task

Changed files
+3 -1
lib
tasks
+3 -1
lib/tasks/posts.rake
··· 21 WHERE feed_posts.id IS NULL AND posts.time < DATETIME('now', '-#{days} days') 22 } 23 24 result = Post.where("id IN (#{subquery})").delete_all 25 26 - puts "Deleted #{result} posts older than #{time_limit}" 27 end
··· 21 WHERE feed_posts.id IS NULL AND posts.time < DATETIME('now', '-#{days} days') 22 } 23 24 + time_start = Time.now 25 result = Post.where("id IN (#{subquery})").delete_all 26 + time_end = Time.now 27 28 + puts "#{time_end}: Deleted #{result} posts older than #{time_limit} in #{(time_end - time_start)}s" 29 end