From d7cc844bd95b7ca2de76a3bd68ef35e63a7b5e94 Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 29 Aug 2021 03:36:16 -0500 Subject: [PATCH] rake: add task for reindexing posts in iqdb. --- lib/tasks/danbooru.rake | 10 ++++++++++ lib/tasks/iqdb.rake | 8 -------- 2 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 lib/tasks/iqdb.rake diff --git a/lib/tasks/danbooru.rake b/lib/tasks/danbooru.rake index 33761b928..00c1ba964 100644 --- a/lib/tasks/danbooru.rake +++ b/lib/tasks/danbooru.rake @@ -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. diff --git a/lib/tasks/iqdb.rake b/lib/tasks/iqdb.rake deleted file mode 100644 index c4549dcc0..000000000 --- a/lib/tasks/iqdb.rake +++ /dev/null @@ -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