mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
FIX: Enforce proper max for clean_orphan_uploads_grace_period_hours (#25235)
* FIX: Enforce proper max for clean_orphan_uploads_grace_period_hours * Cast * Set clean_orphan_uploads_grace_period_hours to max allowed
This commit is contained in:
parent
830ca2877d
commit
9bc78625af
@ -1488,7 +1488,9 @@ files:
|
||||
regex: '\A((https?:\/\/.+)(\|https?:\/\/.+[|$])*)?\z'
|
||||
create_thumbnails: true
|
||||
clean_up_uploads: true
|
||||
clean_orphan_uploads_grace_period_hours: 48
|
||||
clean_orphan_uploads_grace_period_hours:
|
||||
default: 48
|
||||
max: 168
|
||||
purge_deleted_uploads_grace_period_days:
|
||||
default: 30
|
||||
max: 36500
|
||||
|
@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SetMaxCleanOrphanUploadsGracePeriodHours < ActiveRecord::Migration[7.0]
|
||||
def up
|
||||
DB.exec <<~SQL
|
||||
UPDATE site_settings SET value = '168' WHERE name ='clean_orphan_uploads_grace_period_hours' and value::int > 168;
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration.new
|
||||
end
|
||||
end
|
@ -84,7 +84,7 @@ class ImportScripts::Base
|
||||
clean_up_inactive_users_after_days: 0,
|
||||
clean_up_unused_staged_users_after_days: 0,
|
||||
clean_up_uploads: false,
|
||||
clean_orphan_uploads_grace_period_hours: 1800,
|
||||
clean_orphan_uploads_grace_period_hours: 168,
|
||||
}
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user