update iqdb after post replacements (#3885)

This commit is contained in:
Albert Yi
2018-09-11 12:20:52 -07:00
parent 42f7b17a30
commit e58172483b
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env ruby
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment'))
CurrentUser.user = User.system
CurrentUser.ip_addr = "127.0.0.1"
PostReplacement.where("created_at > ?", 6.months.ago).find_each do |pr|
post = pr.post
if post.has_preview?
puts "queuing for #{post.id}"
Post.iqdb_sqs_service.send_message("update\n#{post.id}\n#{post.preview_file_url}")
end
end