search_and_resque 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/search_and_resque.rb +4 -0
- data/lib/search_and_resque/queue.rb +4 -5
- data/lib/search_and_resque/version.rb +1 -1
- 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: 7df05ec8241b807b79297c0162da94d081f5a59e
|
4
|
+
data.tar.gz: cd629b3038930463f0518d05a469626ac784d9ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9c3b05a1dcff21ce0ef93a4a830bff88210c27873773ed76c789a8c7dc2490e8f93f02393e5b067c3396e9fc6bc39cfe89384dd2fa75bec83eb87ed315caf04
|
7
|
+
data.tar.gz: aad5a15f83e7727c7af2f06b3775a6e23d8ca221d9c5af32f9a650ffa547d8dbfd870579a82396b5f28a2ea8a08e6ba43eda2986fccedc6dfecbbee44617b10d
|
data/lib/search_and_resque.rb
CHANGED
@@ -4,21 +4,20 @@ module SearchAndResque
|
|
4
4
|
attr_accessor :queue
|
5
5
|
end
|
6
6
|
|
7
|
-
def self.perform(
|
8
|
-
|
9
|
-
type = index.types.find{ |t| t.type_name == type_name }
|
7
|
+
def self.perform(type_name, action, ids)
|
8
|
+
type = SearchAndResque.index.types.find{ |t| t.type_name == type_name }
|
10
9
|
type.send(action, ids)
|
11
10
|
end
|
12
11
|
|
13
12
|
def self.enqueue_update(type_name, ids)
|
14
13
|
unless ids.empty?
|
15
|
-
Resque.enqueue(self,
|
14
|
+
Resque.enqueue(self, type_name, :import!, ids)
|
16
15
|
end
|
17
16
|
end
|
18
17
|
|
19
18
|
def self.enqueue_delete(type_name, ids)
|
20
19
|
unless ids.empty?
|
21
|
-
Resque.enqueue(self,
|
20
|
+
Resque.enqueue(self, type_name, :delete!, ids)
|
22
21
|
end
|
23
22
|
end
|
24
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: search_and_resque
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Woo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|