promiscuous 0.10 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/promiscuous/publisher/worker.rb +9 -0
- data/lib/promiscuous/version.rb +1 -1
- metadata +2 -2
@@ -7,7 +7,16 @@ class Promiscuous::Publisher::Worker
|
|
7
7
|
1.second
|
8
8
|
end
|
9
9
|
|
10
|
+
def check_indexes
|
11
|
+
Promiscuous::Publisher::Mongoid::Defer.klasses.values.each do |klass|
|
12
|
+
unless klass.collection.indexes.any? { |i| i['key'].keys.include? '_psp' }
|
13
|
+
raise 'Please run rake db:mongoid:create_indexes'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
10
18
|
def replicate
|
19
|
+
check_indexes
|
11
20
|
EM.defer proc { self.replicate_once },
|
12
21
|
proc { EM::Timer.new(self.class.poll_delay) { replicate } }
|
13
22
|
end
|
data/lib/promiscuous/version.rb
CHANGED
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:
|
4
|
+
version: 0.10.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -157,8 +157,8 @@ files:
|
|
157
157
|
- lib/promiscuous/common.rb
|
158
158
|
- lib/promiscuous/publisher.rb
|
159
159
|
- lib/promiscuous/subscriber.rb
|
160
|
-
- lib/promiscuous/version.rb
|
161
160
|
- lib/promiscuous/worker.rb
|
161
|
+
- lib/promiscuous/version.rb
|
162
162
|
- lib/promiscuous.rb
|
163
163
|
- README.md
|
164
164
|
homepage: http://github.com/crowdtap/promiscuous
|