Skip to content

Commit

Permalink
#2029 Generate a new job for importing nexus data from a file
Browse files Browse the repository at this point in the history
This commits the result of
`bin/rails generate job import_nexus --queue import_nexus`

Testing that import_nexus jobs can be created and run:
* From `bin/rails c`, do `::ImportNexusJob.perform_later()`
* From an app shell, do `QUEUE=import_nexus rake jobs:workoff` - it should report a nexus_import job was run (if you `puts` some text from your job you should see the text in your console)
  • Loading branch information
kleintom committed Apr 23, 2024
1 parent a03100b commit acd6537
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/jobs/import_nexus_job.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class ImportNexusJob < ApplicationJob
queue_as :import_nexus

def perform(*args)
# Do something later
end
end
2 changes: 1 addition & 1 deletion exe/delayed_job
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -e

cd /app
exec chpst -u app env QUEUE=project_download,cached_map,dwca_export,coldp_export,basic_nomenclature_export,dwc_occurrence_index,dwca_build_index,import_dataset_import,import_dataset_stage,cache,query_batch_update /usr/bin/bundle exec rails jobs:work
exec chpst -u app env QUEUE=project_download,cached_map,dwca_export,coldp_export,basic_nomenclature_export,dwc_occurrence_index,dwca_build_index,import_dataset_import,import_dataset_stage,cache,query_batch_update,import_nexus /usr/bin/bundle exec rails jobs:work
5 changes: 5 additions & 0 deletions spec/jobs/import_nexus_job_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'rails_helper'

RSpec.describe ImportNexusJob, type: :job do
pending "add some examples to (or delete) #{__FILE__}"
end

0 comments on commit acd6537

Please sign in to comment.