make rubocop happy

This commit is contained in:
Régis Hanol 2018-06-04 19:06:52 +02:00
parent ab8cdd6b5b
commit 6024fb84cc
1 changed files with 2 additions and 2 deletions

View File

@ -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