rake: add task for reindexing posts in iqdb.
This commit is contained in:
@@ -4,6 +4,16 @@ namespace :danbooru do
|
|||||||
Clockwork::run
|
Clockwork::run
|
||||||
end
|
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
|
namespace :docker do
|
||||||
# Note that uncommited changes won't be included in the image; commit
|
# Note that uncommited changes won't be included in the image; commit
|
||||||
# changes first before building the image.
|
# changes first before building the image.
|
||||||
|
|||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user