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
|
module_function
|
||||||
|
|
||||||
def hourly
|
def hourly
|
||||||
queue PruneUploadsJob
|
|
||||||
queue PrunePostsJob
|
queue PrunePostsJob
|
||||||
queue PruneRateLimitsJob
|
queue PruneRateLimitsJob
|
||||||
queue RegeneratePostCountsJob
|
queue RegeneratePostCountsJob
|
||||||
|
|||||||
@@ -88,12 +88,6 @@ class Upload < ApplicationRecord
|
|||||||
self.server = Socket.gethostname
|
self.server = Socket.gethostname
|
||||||
end
|
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)
|
def self.visible(user)
|
||||||
if user.is_admin?
|
if user.is_admin?
|
||||||
all
|
all
|
||||||
|
|||||||
Reference in New Issue
Block a user