mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
make rubocop happy
This commit is contained in:
parent
ab8cdd6b5b
commit
6024fb84cc
@ -4,14 +4,14 @@ module Jobs
|
||||
|
||||
def execute(args)
|
||||
grace_period = [SiteSetting.clean_orphan_uploads_grace_period_hours, 1].max
|
||||
|
||||
|
||||
# always remove invalid upload records
|
||||
Upload
|
||||
.where("retain_hours IS NULL OR created_at < current_timestamp - interval '1 hour' * retain_hours")
|
||||
.where("created_at < ?", grace_period.hour.ago)
|
||||
.where(url: "")
|
||||
.destroy_all
|
||||
|
||||
|
||||
return unless SiteSetting.clean_up_uploads?
|
||||
|
||||
base_url = Discourse.store.internal? ? Discourse.store.relative_base_url : Discourse.store.absolute_base_url
|
||||
|
Loading…
Reference in New Issue
Block a user