isomorfeus-operation 2.4.2 → 2.5.2

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: bdf2b1a40d0a96cacf6746579287fce85b753e85ba425283959bb26c37b35fc0
4
- data.tar.gz: 7abdfc3a47bce004719a44af2a0835b4edcca263a3b6a090fe9877e1b8e191a0
3
+ metadata.gz: 57fb2e2236b8d3ae83971c189e402eb8bde8588e0fc18e929d35d6e421e77d1b
4
+ data.tar.gz: 46d22bd81e18a12160b291b2dc2a00bd82156f892f32c6a5c728f5251698bf86
5
5
  SHA512:
6
- metadata.gz: a68b3a6bef62b2ee4151e03d671496004c168c0eedf4c676e9948fa415e3f8e7090724071c00cfb2fb057c0f2e088f2b3c5e6181f58157604a072837267427e4
7
- data.tar.gz: bb05eaac955cd20b39b3384582ff1c58852e208ae259b17a6840c6ab0fcefc2577a923a575e245da1da48010ea205de8daf569ef31dc7f4a6e0f0561eab9cbbd
6
+ metadata.gz: b1b8fb685d88bc3c9309364db3450fd5808b2750f62ca7b1cb1a9903819880d5aad145758d8b5615c0a847f8c04254aa6492a339aa09fc058e98c77540fc6c39
7
+ data.tar.gz: b5264b897ec1071f66b00e344d53cf5d99e0280d4f026ddba70b1042c38a0ccd8b56cb905d54ac4c036287513322d083e2a522f62f366ebf09b8d13b0bca72c2
@@ -10,7 +10,7 @@ module Isomorfeus
10
10
  attribute :props
11
11
  attribute :user_class_name, class: String, default: 'Anonymous'
12
12
  attribute :user_key, class: String, default: 'anonymous'
13
- attribute :state, class: String, required: true, index: :value, ensure: proc { |v| Isomorfeus::Operation::DailyTask::STATES.include?(v) ? v : 'ready' }
13
+ attribute :state, class: String, required: true, index: :yes, ensure: proc { |v| Isomorfeus::Operation::DailyTask::STATES.include?(v) ? v : 'ready' }
14
14
  attribute :exception
15
15
  attribute :rtime
16
16
  attribute :fail, default: true
@@ -10,7 +10,7 @@ module Isomorfeus
10
10
  attribute :props
11
11
  attribute :user_class_name, class: String, default: 'Anonymous'
12
12
  attribute :user_key, class: String, default: 'anonymous'
13
- attribute :state, class: String, required: true, index: :value, ensure: proc { |v| Isomorfeus::Operation::DeferredTask::STATES.include?(v) ? v : 'ready' }
13
+ attribute :state, class: String, required: true, index: :yes, ensure: proc { |v| Isomorfeus::Operation::DeferredTask::STATES.include?(v) ? v : 'ready' }
14
14
  attribute :exception
15
15
  attribute :rtime
16
16
 
@@ -52,16 +52,12 @@ module Isomorfeus
52
52
 
53
53
  def mark_as_running(task)
54
54
  result = false
55
- @task_class.object_expander.environment.transaction do
56
- task = @task_class.load(key: task.key)
57
- if task.rtime.nil? || (task.rtime - @rtime) >= @timer_task.execution_interval
58
- if task.state == 'ready'
59
- task.state = 'running'
60
- task.rtime = @rtime
61
- task.save
62
- result = true
63
- end
64
- end
55
+ task = @task_class.load(key: task.key)
56
+ if task && (task.rtime.nil? || (task.rtime - @rtime) >= @timer_task.execution_interval) && task.state == 'ready'
57
+ task.state = 'running'
58
+ task.rtime = @rtime
59
+ task.save
60
+ result = true
65
61
  end
66
62
  result
67
63
  end
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Operation
3
- VERSION = '2.4.2'
3
+ VERSION = '2.5.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-operation
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.2
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-28 00:00:00.000000000 Z
11
+ date: 2022-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.9
33
+ version: 1.1.10
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.1.9
40
+ version: 1.1.10
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: oj
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,42 +86,42 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.14.22
89
+ version: 0.14.24
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.14.22
96
+ version: 0.14.24
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: isomorfeus-data
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 2.4.2
103
+ version: 2.5.2
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 2.4.2
110
+ version: 2.5.2
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: isomorfeus-policy
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 2.4.2
117
+ version: 2.5.2
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 2.4.2
124
+ version: 2.5.2
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: isomorfeus-preact
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -156,28 +156,28 @@ dependencies:
156
156
  requirements:
157
157
  - - '='
158
158
  - !ruby/object:Gem::Version
159
- version: 2.4.2
159
+ version: 2.5.2
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
- version: 2.4.2
166
+ version: 2.5.2
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: isomorfeus
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - '='
172
172
  - !ruby/object:Gem::Version
173
- version: 2.4.2
173
+ version: 2.5.2
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - '='
179
179
  - !ruby/object:Gem::Version
180
- version: 2.4.2
180
+ version: 2.5.2
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rake
183
183
  requirement: !ruby/object:Gem::Requirement