update iqdb after post replacements (#3885)
This commit is contained in:
@@ -129,6 +129,8 @@ class UploadService
|
|||||||
replacement.save!
|
replacement.save!
|
||||||
post.save!
|
post.save!
|
||||||
|
|
||||||
|
post.update_iqdb_async
|
||||||
|
|
||||||
rescale_notes(post)
|
rescale_notes(post)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
14
script/fixes/055_reindex_replacements_in_iqdb.rb
Normal file
14
script/fixes/055_reindex_replacements_in_iqdb.rb
Normal 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
|
||||||
Reference in New Issue
Block a user