Class: Gitlab::BackgroundMigration::MoveCiBuildsMetadata::EnvConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/background_migration/move_ci_builds_metadata.rb

Overview

We know that there are installations with years of data that they might not want to migrate so we provide a few switches here to skip old data. The background migrations are executed in Sidekiq, so these should be set as ENV variables on nodes that execute the Sidekiq jobs and Sidekiq must be restarted after they are changed. There should be a line in log/application_json.log showing what values are used.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEnvConfig

Returns a new instance of EnvConfig.



92
93
94
95
96
97
# File 'lib/gitlab/background_migration/move_ci_builds_metadata.rb', line 92

def initialize
  @migration_cutoff = fetch_env_timestamp('GITLAB_DB_CI_JOBS_MIGRATION_CUTOFF')
  @processing_data_cutoff = fetch_env_timestamp('GITLAB_DB_CI_JOBS_PROCESSING_DATA_CUTOFF')
  @processing_data_cutoff ||= processing_data_cutoff_from_db&.seconds&.ago
  @processing_data_cutoff ||= @migration_cutoff
end

Instance Attribute Details

#migration_cutoffObject (readonly)

Returns the value of attribute migration_cutoff.



90
91
92
# File 'lib/gitlab/background_migration/move_ci_builds_metadata.rb', line 90

def migration_cutoff
  @migration_cutoff
end

#processing_data_cutoffObject (readonly)

Returns the value of attribute processing_data_cutoff.



90
91
92
# File 'lib/gitlab/background_migration/move_ci_builds_metadata.rb', line 90

def processing_data_cutoff
  @processing_data_cutoff
end