marty 1.0.29 → 1.0.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/marty/event_view.rb +2 -1
- data/app/models/marty/event.rb +10 -1
- data/app/models/marty/user.rb +0 -4
- data/lib/marty/version.rb +1 -1
- data/spec/models/event_spec.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fc3a16a98d38f381e93606fb1e3c3506c25e799
|
4
|
+
data.tar.gz: b600f2a390ee82dd1654e04dc622225422297085
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 654e32fb7af551f2b69918df7d1875a9762107f75c13514a5457a8472cea089f38764b7cc1749e0695a9594eef5b42ead0054e11b7e259a951b79faf1102b718
|
7
|
+
data.tar.gz: 0e38a79bf663be9bf4e4450193d53ff509ce42c771df6c7aba9b2541b7a0ab88a496592c28aa1b65781fcda2093e3485733d100edec8d86fadfb99a3200365da
|
data/app/models/marty/event.rb
CHANGED
@@ -259,7 +259,7 @@ SQL
|
|
259
259
|
def self.all_finished
|
260
260
|
@all_finished ||= {
|
261
261
|
data: {},
|
262
|
-
timestamp: Time.zone.parse('
|
262
|
+
timestamp: Time.zone.parse('00:00:00').to_i,
|
263
263
|
}
|
264
264
|
@poll_secs ||= Marty::Config['MARTY_EVENT_POLL_SECS'] || 0
|
265
265
|
time_now_i = Time.zone.now.to_i
|
@@ -301,4 +301,13 @@ SQL
|
|
301
301
|
def self.get_finished(klass, id)
|
302
302
|
all_finished[[klass, id]]
|
303
303
|
end
|
304
|
+
|
305
|
+
def self.cleanup
|
306
|
+
begin
|
307
|
+
where('start_dt < ?', Time.zone.now - 48.hours).destroy_all
|
308
|
+
rescue => exc
|
309
|
+
Marty::Util.logger.error("event GC error: #{exc}")
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
304
313
|
end
|
data/app/models/marty/user.rb
CHANGED
data/lib/marty/version.rb
CHANGED
data/spec/models/event_spec.rb
CHANGED
@@ -144,13 +144,13 @@ describe Marty::Event do
|
|
144
144
|
expect(ev4.end_dt).not_to be_nil
|
145
145
|
expect(ev4.error).to be_truthy
|
146
146
|
|
147
|
-
expect(af.count).to eq(
|
147
|
+
expect(af.count).to eq(3)
|
148
148
|
expect(af).to include(['testcl3', 987])
|
149
|
-
expect(af).to include(['
|
149
|
+
expect(af).to include(['testcl1', 234])
|
150
150
|
expect(af[['testcl3', 987]]).to include('PRICING')
|
151
151
|
expect(af[['testcl3', 987]]['PRICING']).to start_with(@date_string)
|
152
|
-
expect(af[['
|
153
|
-
expect(af[['
|
152
|
+
expect(af[['testcl1', 234]]).to include('PRICING')
|
153
|
+
expect(af[['testcl1', 234]]['PRICING']).to start_with(@date_string)
|
154
154
|
|
155
155
|
expect(Marty::Event.currently_running('testcl1', 123)).
|
156
156
|
to eq(['AVM', 'CRA', 'PRICING'])
|
@@ -195,7 +195,7 @@ describe Marty::Event do
|
|
195
195
|
"error"=>"f"})
|
196
196
|
|
197
197
|
af = Marty::Event.all_finished
|
198
|
-
expect(af.count).to eq(
|
198
|
+
expect(af.count).to eq(4)
|
199
199
|
expect(af[['testcl3', 987]]).to include('PRICING')
|
200
200
|
expect(af[['testcl1', 123]]).to include('AVM')
|
201
201
|
expect(af[['testcl1', 123]]['AVM']).to start_with(@date_string)
|
@@ -227,7 +227,7 @@ describe Marty::Event do
|
|
227
227
|
to raise_error(%r!PG::.*invalid input value for enum.*"AMV"!)
|
228
228
|
Marty::Event.clear_cache
|
229
229
|
af = Marty::Event.all_finished
|
230
|
-
expect(af.count).to eq(
|
230
|
+
expect(af.count).to eq(5)
|
231
231
|
expect(af).to include(['testcl', 1234])
|
232
232
|
expect(af).to include(['testcl', 2345])
|
233
233
|
expect(af[['testcl', 1234]]).to include('AVM')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arman Bostani
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2017-06-
|
17
|
+
date: 2017-06-26 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: pg
|