diff --git a/app/controllers/api/v1/books/populate_controller.rb b/app/controllers/api/v1/books/populate_controller.rb index bbc50d510..ad14c7168 100644 --- a/app/controllers/api/v1/books/populate_controller.rb +++ b/app/controllers/api/v1/books/populate_controller.rb @@ -27,7 +27,7 @@ def update track_book_populate_queued do PopulateBookJob.perform_later current_user, @book, @case end - + head :no_content end @@ -45,7 +45,7 @@ def track_book_populate_queued # Yield to the block to perform the job yield if block_given? - end + end end end end diff --git a/app/controllers/books/import_controller.rb b/app/controllers/books/import_controller.rb index 9a3ae38c3..37a043264 100644 --- a/app/controllers/books/import_controller.rb +++ b/app/controllers/books/import_controller.rb @@ -59,7 +59,7 @@ def create @book.import_file.attach(io: StringIO.new(compressed_data), filename: "book_import_#{@book.id}.bin.zip", content_type: 'application/zip') @book.save - + track_book_import_queued do ImportBookJob.perform_later current_user, @book end @@ -77,12 +77,12 @@ def create def read_json file JSON.parse(file.read) end - + def track_book_import_queued @book.update(import_job: "queued at #{Time.zone.now}") # Yield to the block to perform the job yield if block_given? - end + end end end diff --git a/app/jobs/populate_snapshot_job.rb b/app/jobs/populate_snapshot_job.rb index 2982c65e7..8185c70c9 100644 --- a/app/jobs/populate_snapshot_job.rb +++ b/app/jobs/populate_snapshot_job.rb @@ -2,7 +2,7 @@ class PopulateSnapshotJob < ApplicationJob queue_as :default - + # rubocop:disable Security/MarshalLoad def perform snapshot # down the road we should be using ActiveRecord-import and first_or_initialize instead.