chore(job): config delayed job for long-living export jobs
This commit is contained in:
parent
6b87c290cb
commit
86f15b8c05
3 changed files with 12 additions and 0 deletions
|
@ -21,6 +21,10 @@ class ApplicationJob < ActiveJob::Base
|
|||
ENV.fetch("MAX_ATTEMPTS_JOBS", DEFAULT_MAX_ATTEMPTS_JOBS).to_i
|
||||
end
|
||||
|
||||
def max_run_time
|
||||
4.hours # decrease run time by default
|
||||
end
|
||||
|
||||
def request_id
|
||||
@request_id ||= Current.request_id
|
||||
end
|
||||
|
|
|
@ -7,6 +7,10 @@ class ExportJob < ApplicationJob
|
|||
Sentry.set_tags(procedure: job.arguments.first.procedure.id)
|
||||
end
|
||||
|
||||
def max_run_time
|
||||
Export::MAX_DUREE_GENERATION
|
||||
end
|
||||
|
||||
def perform(export)
|
||||
return if export.generated?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue