rails_execution 0.1.9 → 0.1.11
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c17d0628b218854f54ddf3f1d6f6822a3a8e32a3859f94a7b317d3bce32c60b8
|
4
|
+
data.tar.gz: 39603bbb4969b23e36b5842b6ab6e8bb85d2a9dfa1c4ec574a85bf27abeec17e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a576d9c22c9b9743eb9e81c0f8ce1b4e25a5ef6001418fcd39eb4abcd922b3b35203f01d8e2ffa0e3d1aa882f2198c82f08a5483a6e6413daa49b79225d887aa
|
7
|
+
data.tar.gz: a6a142377c25d69e0a7e3e3a2c776f3520d9dbb9eb0bce0ee13187174bb2aa50ef1dc0e51101eabdd3b2eb8c5286f085520540f74895a48b3b5cdb8334634bfd
|
@@ -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
|
@@ -20,7 +20,9 @@ module RailsExecution
|
|
20
20
|
setup_logger!
|
21
21
|
execute_class!
|
22
22
|
is_successful = true
|
23
|
-
rescue
|
23
|
+
rescue => e
|
24
|
+
Rails.logger.info('#' * 30)
|
25
|
+
Rails.logger.error(e)
|
24
26
|
is_successful = false
|
25
27
|
ensure
|
26
28
|
restore_logger!
|
@@ -44,7 +46,7 @@ module RailsExecution
|
|
44
46
|
class #{class_name} < ::RailsExecution::Services::Executor
|
45
47
|
def call
|
46
48
|
task.with_lock do
|
47
|
-
stop!('Task is being executed by another process') if task.is_processing?
|
49
|
+
stop!('Task is being executed by another process') if task.is_processing? && task.jid.blank?
|
48
50
|
|
49
51
|
task.update!(status: :processing)
|
50
52
|
#{task.script}
|
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.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Khoa Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01
|
11
|
+
date: 2024-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|