saseo 0.4.1 → 0.4.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
  SHA1:
3
- metadata.gz: dd8922670e32782ea4fb6f13bf50d9c2b9ef22e7
4
- data.tar.gz: 6bde66f4b1505a25cb04809816203bf885ea4258
3
+ metadata.gz: efac319d8ac0d7bef303804e3f61c60ccd53770a
4
+ data.tar.gz: 22795d70bf7e7c4f456f6a99fd34706bca550d25
5
5
  SHA512:
6
- metadata.gz: e188da5e002b2247c09f0a7708008141b92cf211f332511d58d9887bde0b8b35980af1dabad9ee776f3dd071f0006bcec455b5921d01994747a85f93f614556d
7
- data.tar.gz: 5ef4b0ccc05fafbc654c845f4fcd03a6b8d336980f6ec1b412a57198800a796fa7ba64c03cff7f67f55b9fdb5899e44f2c61cb91484b557b1c731a3f65c21e4e
6
+ metadata.gz: 6a95a035ec3290969b335a85effe1a9fe20d9666d1d9509cf840252b314e12e996a8212289dd10515d51e79676133e511f0000f5610317845bed2243b23fd2d1
7
+ data.tar.gz: 1d0d3a181cbe04f17c2cffdb247ea5ee2c8c7fc73ccfc3ff2c67156725803f1a8b253ce92089657b8a93e3b061e413fd13027e72c858dc869de76905cba1aba5
@@ -95,6 +95,7 @@ SQL
95
95
  execute('DROP FUNCTION IF EXISTS saseo.audit_func() CASCADE')
96
96
  execute('DROP FUNCTION IF EXISTS saseo.whodunnit() CASCADE')
97
97
  execute('DROP TABLE IF EXISTS saseo.saseo_source_versions CASCADE')
98
+ execute('DROP SCHEMA IF EXISTS saseo CASCADE')
98
99
  execute('DROP EXTENSION IF EXISTS "uuid-ossp" CASCADE')
99
100
 
100
101
  end
@@ -12,7 +12,7 @@ module Saseo
12
12
 
13
13
  def consume(message)
14
14
  begin
15
- logger.debug { "received version: #{message.id}" }
15
+ logger.debug { "received source version: #{message.id}" }
16
16
  Saseo::Persistence::Persistor.persist! message
17
17
 
18
18
  acknowledge message
@@ -25,7 +25,7 @@ module Saseo
25
25
  trace: e.backtrace
26
26
  }
27
27
 
28
- logger.error { "rejected version: #{error_data}" }
28
+ logger.error { "rejected source version: #{error_data}" }
29
29
 
30
30
  # be sure to create a queue that monitors for saseo_consumer_error: true
31
31
  Philotic::Message.publish(error_data)
@@ -38,11 +38,17 @@ module Saseo
38
38
  version.new_data = message.new_data && Oj.dump(message.new_data)
39
39
 
40
40
  begin
41
- logger.debug { version.attributes }
42
41
  version.save!
43
42
  logger.debug { "saved version: #{message.id}" }
44
43
  rescue ActiveRecord::RecordNotUnique => e
45
44
  Philotic::Message.publish({philotic_message_type: :'saseo.error.duplicate_record'}, version.attributes)
45
+ rescue ActiveRecord::StatementInvalid => e
46
+ if e.message.match /PG::ConnectionBad/
47
+ logger.warn { 'Lost connection to DB, attempting to reconnect.' }
48
+ ActiveRecord::Base.clear_all_connections!
49
+ ActiveRecord::Base.establish_connection
50
+ retry
51
+ end
46
52
  end
47
53
  end
48
54
  end
data/lib/saseo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Saseo
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
data/saseo.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
 
29
29
  spec.add_dependency 'oj'
30
30
  spec.add_dependency 'pg'
31
- spec.add_dependency 'philotic', '~> 1.2'
31
+ spec.add_dependency 'philotic', '~> 1.3'
32
32
  spec.add_dependency 'rails', '>= 3.2'
33
33
  spec.add_dependency 'standalone_migrations', '>= 2.1.5'
34
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saseo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Keyes
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-11 00:00:00.000000000 Z
11
+ date: 2015-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '1.2'
145
+ version: '1.3'
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '1.2'
152
+ version: '1.3'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rails
155
155
  requirement: !ruby/object:Gem::Requirement