promiscuous 1.0.0.beta4 → 1.0.0.beta5

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: a2be6a0c5f3e918b401df4b70498f2120e2493e1
4
- data.tar.gz: 14a8ff258fd6cb14d59d7ad8efb874a37bb5424e
3
+ metadata.gz: 80819caeaff72e0d2634206a082cd8ba0686d5f3
4
+ data.tar.gz: ee744941f13a6dada05b5781f5e5600856ee00d4
5
5
  SHA512:
6
- metadata.gz: d98fd116d3dd2e123a703cca6feb25be23a75ad139df43f0c0e7a1a2091ceb84d782c46ae455f06385f4136d69533ea01243389ab42c5719a1970b68b59e28a4
7
- data.tar.gz: de9801711b20a656c81fc53fcf74c67015e8bd9e9b25c8af1c20a3d0045e02a5008c0b2f3d427ec84e5bc369aa15434ebbe5d11d45a46156043cf2cb3ccdeec8
6
+ metadata.gz: efbd90b25ff49949dd54ac5c2ee06300e5e06ff0cbd9c875d0608dadff15e682062874ec3a7c20ab10589706d1de5e5235e5ec6119246fb3b718577305e54096
7
+ data.tar.gz: 0c55d26471375d3933f61bb24c8ee9490b6268db57e4d93d7ea98ecab12dfa2e9bfc3fd7fde099a9da9f43524936c5a91801960980834e139b8322e1d7fafa6a
@@ -89,8 +89,8 @@ class Promiscuous::AMQP::Bunny
89
89
  @callback_mapping[tag] = options[:on_confirm] if options[:on_confirm]
90
90
  end
91
91
  rescue Exception => e
92
+ Promiscuous.warn("[publish] Failure publishing to rabbit #{e}\n#{e.backtrace.join("\n")}")
92
93
  e = Promiscuous::Error::Publisher.new(e, :payload => options[:payload])
93
- Promiscuous.warn "[publish] #{e}\n#{e.backtrace.join("\n")}"
94
94
  Promiscuous::Config.error_notifier.call(e)
95
95
  end
96
96
 
@@ -201,7 +201,7 @@ class Moped::PromiscuousQueryWrapper < Moped::Query
201
201
  end
202
202
 
203
203
  def remove_all
204
- raise "Instead of doing a multi delete, delete each document separatly.\n" +
204
+ raise "Promiscuous: Instead of doing a multi delete, delete each document separatly.\n" +
205
205
  "Declare your has_many relationships with :dependent => :destroy instead of :delete"
206
206
  end
207
207
  end
@@ -46,7 +46,10 @@ class Promiscuous::Publisher::Transport::Batch
46
46
  end
47
47
  rescue Exception => e
48
48
  Promiscuous.warn("[publish] Failure publishing to rabbit #{e}\n#{e.backtrace.join("\n")}")
49
- raise e if raise_error
49
+ e = Promiscuous::Error::Publisher.new(e, :payload => self.payload)
50
+ Promiscuous::Config.error_notifier.call(e)
51
+
52
+ raise e.inner if raise_error
50
53
  end
51
54
  end
52
55
 
@@ -90,7 +93,7 @@ class Promiscuous::Publisher::Transport::Batch
90
93
  else
91
94
  find_instance(attributes)
92
95
  end
93
- end
96
+ end.compact
94
97
  self.new(dump['type'], instances)
95
98
  end
96
99
 
@@ -9,7 +9,7 @@ class Promiscuous::Publisher::Transport::Persistence::Mongoid
9
9
  end
10
10
 
11
11
  def delete(batch)
12
- Storage.find(batch.id).destroy
12
+ Storage.collection.find(:_id => batch.id).remove
13
13
  end
14
14
 
15
15
  class Storage
@@ -18,7 +18,7 @@ class Promiscuous::Redis
18
18
  end
19
19
 
20
20
  def self.disconnect
21
- self.connection.quit
21
+ self.connection.try(:quit)
22
22
  end
23
23
 
24
24
  def self.lost_connection_exception(node, options={})
@@ -31,5 +31,9 @@ module Promiscuous::Subscriber::Model::ActiveRecord
31
31
  promiscuous_root_class.find_by(key => id)
32
32
  end
33
33
  end
34
+
35
+ def __promiscuous_with_pooled_connection
36
+ ActiveRecord::Base.connection_pool.with_connection { yield }
37
+ end
34
38
  end
35
39
  end
@@ -101,5 +101,9 @@ module Promiscuous::Subscriber::Model::Base
101
101
  def __promiscuous_fetch_new(id)
102
102
  new.tap { |m| m.__send__("#{subscribe_foreign_key}=", id) }
103
103
  end
104
+
105
+ def __promiscuous_with_pooled_connection
106
+ yield
107
+ end
104
108
  end
105
109
  end
@@ -35,7 +35,7 @@ class Promiscuous::Subscriber::Worker::EventualDestroyer
35
35
  def perform
36
36
  model = class_name.constantize
37
37
  begin
38
- model.__promiscuous_fetch_existing(instance_id).destroy
38
+ model.__promiscuous_with_pooled_connection { model.__promiscuous_fetch_existing(instance_id).destroy }
39
39
  rescue model.__promiscuous_missing_record_exception
40
40
  end
41
41
 
@@ -1,3 +1,3 @@
1
1
  module Promiscuous
2
- VERSION = '1.0.0.beta4'
2
+ VERSION = '1.0.0.beta5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promiscuous
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta4
4
+ version: 1.0.0.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Viennot
@@ -9,104 +9,104 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-03 00:00:00.000000000 Z
12
+ date: 2014-07-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '3'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '3'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activemodel
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '3'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '3'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: bunny
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: 0.10.7
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: 0.10.7
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: amq-protocol
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: 1.8.0
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: 1.8.0
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: ruby-progressbar
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ~>
74
+ - - "~>"
75
75
  - !ruby/object:Gem::Version
76
76
  version: 1.2.0
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ~>
81
+ - - "~>"
82
82
  - !ruby/object:Gem::Version
83
83
  version: 1.2.0
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: redis
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ~>
88
+ - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 3.0.2
90
+ version: '3.0'
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ~>
95
+ - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 3.0.2
97
+ version: '3.0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: algorithms
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ~>
102
+ - - "~>"
103
103
  - !ruby/object:Gem::Version
104
104
  version: 0.6.1
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ~>
109
+ - - "~>"
110
110
  - !ruby/object:Gem::Version
111
111
  version: 0.6.1
112
112
  - !ruby/object:Gem::Dependency
@@ -127,28 +127,28 @@ dependencies:
127
127
  name: multi_json
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - ~>
130
+ - - "~>"
131
131
  - !ruby/object:Gem::Version
132
132
  version: 1.8.0
133
133
  type: :runtime
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ~>
137
+ - - "~>"
138
138
  - !ruby/object:Gem::Version
139
139
  version: 1.8.0
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: robust-redis-lock
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - ~>
144
+ - - "~>"
145
145
  - !ruby/object:Gem::Version
146
146
  version: 0.2.2
147
147
  type: :runtime
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - ~>
151
+ - - "~>"
152
152
  - !ruby/object:Gem::Version
153
153
  version: 0.2.2
154
154
  description: Replicate models across applications
@@ -239,19 +239,18 @@ require_paths:
239
239
  - lib
240
240
  required_ruby_version: !ruby/object:Gem::Requirement
241
241
  requirements:
242
- - - '>='
242
+ - - ">="
243
243
  - !ruby/object:Gem::Version
244
244
  version: '0'
245
245
  required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  requirements:
247
- - - '>'
247
+ - - ">"
248
248
  - !ruby/object:Gem::Version
249
249
  version: 1.3.1
250
250
  requirements: []
251
251
  rubyforge_project:
252
- rubygems_version: 2.0.14
252
+ rubygems_version: 2.1.11
253
253
  signing_key:
254
254
  specification_version: 4
255
255
  summary: Replicate models across applications
256
256
  test_files: []
257
- has_rdoc: false