rails_execution 0.1.8 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 566c0596d18b5bbd18ff726beb02b0ce9f4c0fe8f4dfe376d235f4a175714915
4
- data.tar.gz: 233e83813184e919ba323fa577b29c620ae5c2c34c529518b676aaff4f2d7fd1
3
+ metadata.gz: 7a7f3fd0259f76d5345fa0ebb86b51445193a21944032ecbe41ff3d35cfb3514
4
+ data.tar.gz: 761275ff6d42de49b759e3076085d38c6b3cc4b81524004eea41160ece2123e5
5
5
  SHA512:
6
- metadata.gz: cbbbb5d454bda3f849d67edf860bf788c39b40d3a8a70685e57c448174694bd15187a306ac5e3556d5feedc67485531d56af6b9c88b7bbd79fb838e7c1de592a
7
- data.tar.gz: f2b80a8f6d5ebb98ca8f5a9ead50218c42bea603709d6816f1f29e92a9a2005a44c2c6cd0039e130e90574ea28ba000e34bc0cc25e49e5ecddbfd1f5ffb5a0f6
6
+ metadata.gz: 6db17f4b23202789f7b131785b2218b4e18ef8513cd6b11e87593d2ef054c82a8535e2070ee94ec51f206d411447d72dda245364355b4c67ce65b7fd834e73bd
7
+ data.tar.gz: 2ce2d6380ea0bce57999eeba74707c38e2649bf9c714b5d31b52fb237c5e28e73f6c09945442651d411efceb56f70a37dade6618ee9b4549e707a60fdd70920f
@@ -1,3 +1,3 @@
1
1
  - if task_attachment_files.any?
2
2
  = re_card_content do
3
- = render partial: 'attachments', locals: { task_attachment_files: }
3
+ = render partial: 'attachments', locals: { task_attachment_files: task_attachment_files }
@@ -31,7 +31,7 @@
31
31
  = f.datetime_local_field :scheduled_at, class: "form-control", placeholder: "Select Datetime"
32
32
  = f.select :repeat_mode, options_for_select(task.repeat_mode_select_options.invert, f.object.repeat_mode), {}, class: "form-control", disabled: !task.scheduled_at?
33
33
  - if RailsExecution.configuration.file_upload
34
- .mt-4= render partial: 'attachments', locals: { task_attachment_files: }
34
+ .mt-4= render partial: 'attachments', locals: { task_attachment_files: task_attachment_files }
35
35
  #attachment_files.mb-3
36
36
  %ul.list-unstyled= render partial: 'attachment_file_fields'
37
37
 
@@ -39,9 +39,9 @@ module RailsExecution
39
39
  def setup
40
40
  task.with_lock do
41
41
  unless task.is_processing?
42
- task.update(status: :processing)
43
42
  task.activities.create(owner: owner, message: 'Process the task with background job')
44
- ::RailsExecution.configuration.task_background_executor.call(task.id)
43
+ jid = ::RailsExecution.configuration.task_background_executor.call(task.id)
44
+ task.update!(status: :processing, jid: jid.presence)
45
45
  end
46
46
  end
47
47
  end
@@ -44,6 +44,9 @@ module RailsExecution
44
44
  class #{class_name} < ::RailsExecution::Services::Executor
45
45
  def call
46
46
  task.with_lock do
47
+ stop!('Task is being executed by another process') if task.is_processing? && task.jid.blank?
48
+
49
+ task.update!(status: :processing)
47
50
  #{task.script}
48
51
  end
49
52
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsExecution
4
- VERSION = '0.1.8'
4
+ VERSION = '0.1.10'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_execution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Khoa Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-02 00:00:00.000000000 Z
11
+ date: 2024-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml