debian-mirror-gitlab/lib/gitlab/pages/settings.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
614 B
Ruby
Raw Normal View History

2020-10-24 23:57:45 +05:30
# frozen_string_literal: true
module Gitlab
module Pages
class Settings < ::SimpleDelegator
DiskAccessDenied = Class.new(StandardError)
def path
2021-04-29 21:17:54 +05:30
report_denied_disk_access
2020-10-24 23:57:45 +05:30
super
end
2021-04-29 21:17:54 +05:30
private
def disk_access_denied?
return true unless ::Settings.pages.local_store&.enabled
2022-05-07 20:08:51 +05:30
::Gitlab::Runtime.puma? && !::Gitlab::Runtime.test_suite?
2021-04-29 21:17:54 +05:30
end
def report_denied_disk_access
raise DiskAccessDenied if disk_access_denied?
2021-06-08 01:23:25 +05:30
rescue StandardError => e
2021-04-29 21:17:54 +05:30
::Gitlab::ErrorTracking.track_exception(e)
end
2020-10-24 23:57:45 +05:30
end
end
end