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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f0e456b3f2f6ed223ac6cafc65455acd7608648
4
- data.tar.gz: b86ba11ad450399e1a304d91850d2c06f828f8a7
3
+ metadata.gz: 8fc3a16a98d38f381e93606fb1e3c3506c25e799
4
+ data.tar.gz: b600f2a390ee82dd1654e04dc622225422297085
5
5
  SHA512:
6
- metadata.gz: 2b636574915b6152a5e9dcf2c175903cc1caf31c739ba51a870867edd773d5047c0aa0e38f9f6168a2aa699821c7ccdb21d785c1ff7746de8a43acc6c015dc25
7
- data.tar.gz: 0fb3385d4210b1d11e04b26074891ab5479560c47c7d5e15aa0d0055f29654bc40744020a5d3f5fa334af8650fa47468b01f05c89de9e08c8c70735794e59c0d
6
+ metadata.gz: 654e32fb7af551f2b69918df7d1875a9762107f75c13514a5457a8472cea089f38764b7cc1749e0695a9594eef5b42ead0054e11b7e259a951b79faf1102b718
7
+ data.tar.gz: 0e38a79bf663be9bf4e4450193d53ff509ce42c771df6c7aba9b2541b7a0ab88a496592c28aa1b65781fcda2093e3485733d100edec8d86fadfb99a3200365da
@@ -29,7 +29,8 @@ class Marty::EventView < Marty::Grid
29
29
 
30
30
  c.store_config.merge!({sorters: [{property: :id,
31
31
  direction: 'DESC',
32
- }]})
32
+ }]})
33
+ Marty::Event.cleanup
33
34
  end
34
35
 
35
36
  action :delete do |a|
@@ -259,7 +259,7 @@ SQL
259
259
  def self.all_finished
260
260
  @all_finished ||= {
261
261
  data: {},
262
- timestamp: Time.zone.parse('1970-1-1 00:00:00').to_i,
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
@@ -122,10 +122,6 @@ private
122
122
  errors.blank?
123
123
  end
124
124
 
125
- delorean_fn :get_roles, sig: 0 do
126
- Mcfly.whodunnit.roles
127
- end
128
-
129
125
  def user_manager_only
130
126
  Marty::User.has_role("user_manager") && !Marty::User.has_role("admin")
131
127
  end
data/lib/marty/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "1.0.29"
2
+ VERSION = "1.0.30"
3
3
  end
@@ -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(4)
147
+ expect(af.count).to eq(3)
148
148
  expect(af).to include(['testcl3', 987])
149
- expect(af).to include(['testcl2', 123])
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[['testcl2', 123]]).to include('PRICING')
153
- expect(af[['testcl2', 123]]['PRICING']).to eq(@old_end)
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(5)
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(6)
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.29
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-07 00:00:00.000000000 Z
17
+ date: 2017-06-26 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: pg