uploads: stop pruning uploads.
This commit is contained in:
@@ -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
|
||||
@@ -4,7 +4,6 @@ module DanbooruMaintenance
|
||||
module_function
|
||||
|
||||
def hourly
|
||||
queue PruneUploadsJob
|
||||
queue PrunePostsJob
|
||||
queue PruneRateLimitsJob
|
||||
queue RegeneratePostCountsJob
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user