uploads: stop pruning uploads.

This commit is contained in:
evazion
2022-01-28 00:55:47 -06:00
parent 6fbca01a23
commit f11c46b4f8
3 changed files with 0 additions and 16 deletions

View File

@@ -1,9 +0,0 @@
# frozen_string_literal: true
# A job that runs hourly to delete all completed, stale, or failed uploads.
# Spawned by {DanbooruMaintenance}.
class PruneUploadsJob < ApplicationJob
def perform
Upload.prune!
end
end

View File

@@ -4,7 +4,6 @@ module DanbooruMaintenance
module_function
def hourly
queue PruneUploadsJob
queue PrunePostsJob
queue PruneRateLimitsJob
queue RegeneratePostCountsJob

View File

@@ -88,12 +88,6 @@ class Upload < ApplicationRecord
self.server = Socket.gethostname
end
def self.prune!
completed.where("created_at < ?", 1.hour.ago).lock.destroy_all
preprocessed.where("created_at < ?", 1.day.ago).lock.destroy_all
where("created_at < ?", 3.days.ago).lock.destroy_all
end
def self.visible(user)
if user.is_admin?
all