Commit b8709d61 authored by Pedro Pombeiro's avatar Pedro Pombeiro

Add missing not_connected scope to Ci::Runner

Ci::RunnersFinder#filter_by_status! accepts :not_connected, but there's
no scope in Ci::Runner to back it up
parent a309f510
......@@ -39,7 +39,7 @@ module Ci
AVAILABLE_TYPES_LEGACY = %w[specific shared].freeze
AVAILABLE_TYPES = runner_types.keys.freeze
AVAILABLE_STATUSES = %w[active paused online offline].freeze
AVAILABLE_STATUSES = %w[active paused online offline not_connected].freeze
AVAILABLE_SCOPES = (AVAILABLE_TYPES_LEGACY + AVAILABLE_TYPES + AVAILABLE_STATUSES).freeze
FORM_EDITABLE = %i[description tag_list active run_untagged locked access_level maximum_timeout_human_readable].freeze
......@@ -65,6 +65,7 @@ module Ci
# did `contacted_at <= ?` the query would effectively have to do a seq
# scan.
scope :offline, -> { where.not(id: online) }
scope :not_connected, -> { where(contacted_at: nil) }
scope :ordered, -> { order(id: :desc) }
scope :with_recent_runner_queue, -> { where('contacted_at > ?', recent_queue_deadline) }
......
......@@ -13539,6 +13539,7 @@ Values for YAML processor result.
| Value | Description |
| ----- | ----------- |
| <a id="cirunnerstatusactive"></a>`ACTIVE` | A runner that is active. |
| <a id="cirunnerstatusnot_connected"></a>`NOT_CONNECTED` | A runner that is not connected. |
| <a id="cirunnerstatusoffline"></a>`OFFLINE` | A runner that is offline. |
| <a id="cirunnerstatusonline"></a>`ONLINE` | A runner that is online. |
| <a id="cirunnerstatuspaused"></a>`PAUSED` | A runner that is paused. |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment