Module: Gitlab::Import::SetAsyncJid

Defined in:
lib/gitlab/import/set_async_jid.rb

Class Method Summary collapse

Class Method Details

.generate_jid(import_state) ⇒ Object


21
22
23
24
# File 'lib/gitlab/import/set_async_jid.rb', line 21

def self.generate_jid(import_state)
  importer_name = import_state.class.name.underscore.dasherize
  "async-import/#{importer_name}/#{import_state.project_id}"
end

.set_jid(import_state) ⇒ Object


13
14
15
16
17
18
19
# File 'lib/gitlab/import/set_async_jid.rb', line 13

def self.set_jid(import_state)
  jid = generate_jid(import_state)

  Gitlab::SidekiqStatus.set(jid, Gitlab::Import::StuckImportJob::IMPORT_JOBS_EXPIRATION)

  import_state.update_column(:jid, jid)
end