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 21 WHERE feed_posts.id IS NULL AND posts.time < DATETIME('now', '-#{days} days') 22 22 } 23 23 24 + time_start = Time.now 24 25 result = Post.where("id IN (#{subquery})").delete_all 26 + time_end = Time.now 25 27 26 - puts "Deleted #{result} posts older than #{time_limit}" 28 + puts "#{time_end}: Deleted #{result} posts older than #{time_limit} in #{(time_end - time_start)}s" 27 29 end