rake: add task for reindexing posts in iqdb.

This commit is contained in:
evazion
2021-08-29 03:36:16 -05:00
parent 34861678cb
commit d7cc844bd9
2 changed files with 10 additions and 8 deletions

View File

@@ -4,6 +4,16 @@ namespace :danbooru do
Clockwork::run
end
# Schedules all posts to be reindexed in IQDB. Requires the delayed jobs
# worker (bin/delayed_job) to be running.
desc "Reindex all posts in IQDB"
task reindex_iqdb: :environment do
Post.find_each do |post|
puts "post ##{post.id}"
post.update_iqdb
end
end
namespace :docker do
# Note that uncommited changes won't be included in the image; commit
# changes first before building the image.

View File

@@ -1,8 +0,0 @@
namespace :iqdb do
task reindex_posts: :environment do
STDIN.each_line do |post_id|
puts post_id
post.update_iqdb
end
end
end