Class: DownloadProjectSqlJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/download_project_sql_job.rb

Instance Method Summary collapse

Instance Method Details

#max_attemptsObject



8
9
10
# File 'app/jobs/download_project_sql_job.rb', line 8

def max_attempts
  2
end

#max_run_timeObject



4
5
6
# File 'app/jobs/download_project_sql_job.rb', line 4

def max_run_time
  1.hour
end

#perform(target_project, download) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/jobs/download_project_sql_job.rb', line 12

def perform(target_project, download)
  begin
    download.source_file_path = ::Export::ProjectData::Sql.export(target_project)
    download.save!
    download
  rescue => ex
    ExceptionNotifier.notify_exception(ex,
      data: { project: target_project&.id, download: download&.id&.to_s }
    )
    raise
  end
end