Class: Ci::BuildMetadata

Inherits:
ApplicationRecord show all
Extended by:
Gitlab::Ci::Model
Includes:
ChronicDurationAttribute, Gitlab::Utils::StrongMemoize, Presentable
Defined in:
app/models/ci/build_metadata.rb

Overview

The purpose of this class is to store Build related data that can be disposed. Data that should be persisted forever, should be stored with Ci::Build model.

Defined Under Namespace

Classes: BuildTimeout

Instance Method Summary collapse

Methods included from Gitlab::Ci::Model

model_name, table_name_prefix

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods included from ChronicDurationAttribute

#chronic_duration_attributes, #output_chronic_duration_attribute

Methods included from Presentable

#present

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Instance Method Details

#update_timeout_stateObject


40
41
42
43
44
45
46
# File 'app/models/ci/build_metadata.rb', line 40

def update_timeout_state
  timeout = timeout_with_highest_precedence

  return unless timeout

  update(timeout: timeout.value, timeout_source: timeout.source)
end