diff --git a/app/logical/curated_pool_updater.rb b/app/logical/curated_pool_updater.rb deleted file mode 100644 index aa82f314f..000000000 --- a/app/logical/curated_pool_updater.rb +++ /dev/null @@ -1,16 +0,0 @@ -module CuratedPoolUpdater - def self.curated_posts(date_range: (1.week.ago..Time.now), limit: 100) - posts = Post.where(created_at: date_range) - posts = posts.joins(:votes).where("post_votes.score": SuperVoter::MAGNITUDE) - posts = Post.where(id: posts.group(:id).order(Arel.sql("COUNT(*) DESC")).limit(limit)) - posts - end - - def self.update_pool!(pool_id = Danbooru.config.curated_pool_id) - return unless pool_id.present? - - CurrentUser.scoped(User.system, "127.0.0.1") do - Pool.find(pool_id).update!(post_ids: curated_posts.pluck(:id)) - end - end -end diff --git a/app/logical/danbooru_maintenance.rb b/app/logical/danbooru_maintenance.rb index 2fbe595b5..1dae77ab8 100644 --- a/app/logical/danbooru_maintenance.rb +++ b/app/logical/danbooru_maintenance.rb @@ -16,7 +16,6 @@ module DanbooruMaintenance safely { TagChangeRequestPruner.warn_all } safely { TagChangeRequestPruner.reject_all } safely { Ban.prune! } - safely { CuratedPoolUpdater.update_pool! } safely { ActiveRecord::Base.connection.execute("vacuum analyze") unless Rails.env.test? } end diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index ca16e0edb..58b6db211 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -43,11 +43,6 @@ module Danbooru "DanbooruBot" end - # The ID of the "Curated" pool. If present, this pool will be updated daily with curated posts. - def curated_pool_id - nil - end - def source_code_url "https://github.com/danbooru/danbooru" end diff --git a/test/unit/danbooru_maintenance_test.rb b/test/unit/danbooru_maintenance_test.rb index ffb990cfc..54dc1a1b8 100644 --- a/test/unit/danbooru_maintenance_test.rb +++ b/test/unit/danbooru_maintenance_test.rb @@ -10,13 +10,6 @@ class DanbooruMaintenanceTest < ActiveSupport::TestCase assert_nothing_raised { DanbooruMaintenance.daily } end - should "update the curated pool" do - pool = as(@admin) { create(:pool, name: "curated") } - Danbooru.config.stubs(:curated_pool_id).returns(pool.id) - - assert_nothing_raised { DanbooruMaintenance.daily } - end - should "prune expired posts" do @pending = FactoryBot.create(:post, is_pending: true, created_at: 4.days.ago) @flagged = FactoryBot.create(:post, is_flagged: true, created_at: 4.days.ago)