Module: SolidQueueGuard::HttpStatusPolicy Private
- Defined in:
- lib/solid_queue_guard/http_status_policy.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- STATUS_MAP =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ ok: :ok, success: :ok, 200 => :ok, multi_status: :multi_status, 207 => :multi_status, service_unavailable: :service_unavailable, unavailable: :service_unavailable, 503 => :service_unavailable }.freeze
Class Method Summary collapse
- .for_report_status(report_status, config: SolidQueueGuard.config) ⇒ Object private
- .resolve(status) ⇒ Object private
Class Method Details
.for_report_status(report_status, config: SolidQueueGuard.config) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/solid_queue_guard/http_status_policy.rb', line 24 def for_report_status(report_status, config: SolidQueueGuard.config) case report_status.to_s when 'unhealthy' resolve(config.unhealthy_http_status) when 'degraded' resolve(config.degraded_http_status) else :ok end end |
.resolve(status) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 22 |
# File 'lib/solid_queue_guard/http_status_policy.rb', line 19 def resolve(status) key = status.is_a?(Integer) ? status : status.to_sym STATUS_MAP.fetch(key, :ok) end |