Class: SampleAccessioningJob

Inherits:
Struct
  • Object
show all
Defined in:
app/jobs/sample_accessioning_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accessionableObject

Returns the value of attribute accessionable

Returns:

  • (Object)

    the current value of accessionable


1
2
3
# File 'app/jobs/sample_accessioning_job.rb', line 1

def accessionable
  @accessionable
end

Instance Method Details

#max_attemptsObject


12
13
14
# File 'app/jobs/sample_accessioning_job.rb', line 12

def max_attempts
  3
end

#performObject


2
3
4
5
6
# File 'app/jobs/sample_accessioning_job.rb', line 2

def perform
  submission = Accession::Submission.new(User.find_by(api_key: configatron.accession_local_key), accessionable)
  submission.post
  submission.update_accession_number
end

#queue_nameObject


16
17
18
# File 'app/jobs/sample_accessioning_job.rb', line 16

def queue_name
  'sample_accessioning'
end

#reschedule_at(current_time, _attempts) ⇒ Object


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

def reschedule_at(current_time, _attempts)
  current_time + 1.day
end