xapian_db 1.3.10 → 1.3.11

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
  SHA256:
3
- metadata.gz: 5a85e207edfe687e3cdb78beb5056f293b9b152a49ebf8c373e76a67c5057f06
4
- data.tar.gz: 2c103133ef9838b3d243e640fb51d970acb77384ac45cced1269efeb38789479
3
+ metadata.gz: d51dc4c64a7d47ea51d42af7509932b6b15be2c02ec6d0ccd27482b762f4754d
4
+ data.tar.gz: dd2d7382f5537370e73f40bdb7d49d4e96a8b8ae3bfbe911aa54cfc6cff39694
5
5
  SHA512:
6
- metadata.gz: c21ff4ce44b81671de58eae9cd2817e781f473fd6b4518bf5b77def92711e204fcbb3fab45cd245d0776149dedda799a17c56e36109f55c583d51c27c3c90d12
7
- data.tar.gz: a0893f80236829214c7db92f5a0a60bdd72a68ff90fbb84131cdff4e7a531c22163563d2f150a18d09a344e9ba2b66cac17dedc21d1f2ba5756f9239149ed71c
6
+ metadata.gz: abd8997703c4be61c239942432e208e34724e2132f8b7c1ebcf0a74544f03f0f45c665a2571ca97d3e9c6519511113736a124369a2a06fe9ecb67150e06aeba2
7
+ data.tar.gz: 995ac1009c8177051cb63dd3ac001d3e6e33e5788e0b6ef5d24f52be9de71180e8708af77b625c4e72ea1bdce46a9600567e4451840caf7a72615cd1df8b53db
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.3.11 (November 13th, 2023)
2
+
3
+ Changes:
4
+
5
+ - Update sidekiq version
6
+
1
7
  ## 1.3.10 (March 2nd, 2023)
2
8
 
3
9
  Fixes:
@@ -24,16 +24,19 @@ module XapianDb
24
24
  end
25
25
 
26
26
  def index(options)
27
+ options = JSON.parse(options)
27
28
  klass = constantize options['class']
28
29
  obj = klass.respond_to?('get') ? klass.get(options['id']) : klass.find(options['id'])
29
30
  DirectWriter.index obj, true, changed_attrs: options[:changed_attrs]
30
31
  end
31
32
 
32
33
  def delete_doc(options)
34
+ options = JSON.parse(options)
33
35
  DirectWriter.delete_doc_with options['xapian_id']
34
36
  end
35
37
 
36
38
  def reindex_class(options)
39
+ options = JSON.parse(options)
37
40
  klass = constantize options['class']
38
41
  DirectWriter.reindex_class klass, :verbose => false
39
42
  end
@@ -16,20 +16,30 @@ module XapianDb
16
16
 
17
17
  # Update an object in the index
18
18
  # @param [Object] obj An instance of a class with a blueprint configuration
19
- def index(obj, commit=true, changed_attrs: [])
20
- Sidekiq::Client.enqueue worker_class, :index, :class => obj.class.name, :id => obj.id, :changed_attrs => changed_attrs
19
+
20
+ def queue
21
+ XapianDb::Config.sidekiq_queue
22
+ end
23
+
24
+ def index(obj, _commit= true, changed_attrs: [])
25
+ Sidekiq::Client.enqueue_to(queue, worker_class, 'index',
26
+ {
27
+ class: obj.class.name,
28
+ id: obj.id,
29
+ changed_attrs: changed_attrs
30
+ }.to_json)
21
31
  end
22
32
 
23
33
  # Remove an object from the index
24
34
  # @param [String] xapian_id The document id
25
- def delete_doc_with(xapian_id, commit=true)
26
- Sidekiq::Client.enqueue worker_class, :delete_doc, :xapian_id => xapian_id
35
+ def delete_doc_with(xapian_id, _commit= true)
36
+ Sidekiq::Client.enqueue_to(queue, worker_class, 'delete_doc', { xapian_id: xapian_id }.to_json)
27
37
  end
28
38
 
29
39
  # Reindex all objects of a given class
30
40
  # @param [Class] klass The class to reindex
31
- def reindex_class(klass, options = {})
32
- Sidekiq::Client.enqueue worker_class, :reindex_class, :class => klass.name
41
+ def reindex_class(klass, _options = {})
42
+ Sidekiq::Client.enqueue_to(queue, worker_class, 'reindex_class', { class: klass.name }.to_json)
33
43
  end
34
44
 
35
45
  def worker_class
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xapian_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.10
4
+ version: 1.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gernot Kogler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-02 00:00:00.000000000 Z
11
+ date: 2023-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: sidekiq
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 2.13.0
131
+ version: '7.1'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 2.13.0
138
+ version: '7.1'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: xapian-ruby
141
141
  requirement: !ruby/object:Gem::Requirement