mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-13 12:47:11 +08:00
Merge pull request #4675 from artoscinote/ma_SCI_7382
Add missing job [SCI-7382]
This commit is contained in:
commit
212429c5be
1 changed files with 15 additions and 0 deletions
15
app/jobs/my_modules/copy_content_job.rb
Normal file
15
app/jobs/my_modules/copy_content_job.rb
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module MyModules
|
||||||
|
class CopyContentJob < ApplicationJob
|
||||||
|
def perform(user, source_my_module_id, target_my_module_id)
|
||||||
|
MyModule.transaction do
|
||||||
|
target_my_module = MyModule.find(target_my_module_id)
|
||||||
|
MyModule.find(source_my_module_id).copy_content(user, target_my_module)
|
||||||
|
target_my_module.update!(provisioning_status: :done)
|
||||||
|
end
|
||||||
|
rescue StandardError => _e
|
||||||
|
target_my_module.update(provisioning_status: :failed)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue