xapian_db 1.3.8 → 1.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/xapian_db.rb +5 -5
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a219ad5e9648568bdf084f50f5639133fb493a5dd6ec44c59e2adb03102c4bdc
|
4
|
+
data.tar.gz: 472fa6a0894c26c46991d61cd891202aa444f92b661b2f3172856e050e6f30d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f4084aed2f0fce0edc901f695d076d740a61b72ea8e2ccd9b7315af3b7b389478da74d176e2bebf019d8d7f57632595cdc9a436df875c9f5ad16541f49ae96f
|
7
|
+
data.tar.gz: 3f7463fab1bfdec7ff5c47306243c6c48ed10abfb0fbda970246bbc08289431e14c625ef6b98b53013182ac2ac5c9b07565739ec801f1e3add5f8720cf7f661a
|
data/CHANGELOG.md
CHANGED
data/lib/xapian_db.rb
CHANGED
@@ -106,21 +106,21 @@ module XapianDb
|
|
106
106
|
# Update an object in the index
|
107
107
|
# @param [Object] obj An instance of a class with a blueprint configuration
|
108
108
|
def self.index(obj, commit=true, changed_attrs: [])
|
109
|
-
writer =
|
109
|
+
writer = Thread.current[:xapian_db_block_writer] || XapianDb::Config.writer
|
110
110
|
writer.index obj, commit, changed_attrs: changed_attrs
|
111
111
|
end
|
112
112
|
|
113
113
|
# Remove a document from the index
|
114
114
|
# @param [String] xapian_id The document id
|
115
115
|
def self.delete_doc_with(xapian_id, commit=true)
|
116
|
-
writer =
|
116
|
+
writer = Thread.current[:xapian_db_block_writer] || XapianDb::Config.writer
|
117
117
|
writer.delete_doc_with xapian_id, commit
|
118
118
|
end
|
119
119
|
|
120
120
|
# Update or delete a xapian document belonging to an object depending on the ignore_if logic(if present)
|
121
121
|
# @param [Object] object An instance of a class with a blueprint configuration
|
122
122
|
def self.reindex(object, commit=true, changed_attrs: [])
|
123
|
-
writer =
|
123
|
+
writer = Thread.current[:xapian_db_block_writer] || XapianDb::Config.writer
|
124
124
|
blueprint = XapianDb::DocumentBlueprint.blueprint_for object.class.name
|
125
125
|
if blueprint.should_index?(object)
|
126
126
|
writer.index object, commit, changed_attrs: changed_attrs
|
@@ -174,7 +174,7 @@ module XapianDb
|
|
174
174
|
# @option opts [Object] :writer An index writer
|
175
175
|
# @option opts [String] :error_message the error message to log if an error occurs
|
176
176
|
def self.execute_block(opts, &block)
|
177
|
-
|
177
|
+
Thread.current[:xapian_db_block_writer] = opts[:writer]
|
178
178
|
begin
|
179
179
|
block.call
|
180
180
|
rescue Exception => ex
|
@@ -188,7 +188,7 @@ module XapianDb
|
|
188
188
|
raise
|
189
189
|
ensure
|
190
190
|
# release the block writer
|
191
|
-
|
191
|
+
Thread.current[:xapian_db_block_writer] = nil
|
192
192
|
end
|
193
193
|
end
|
194
194
|
end
|
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.
|
4
|
+
version: 1.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gernot Kogler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|
@@ -260,8 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
260
|
- !ruby/object:Gem::Version
|
261
261
|
version: 1.3.6
|
262
262
|
requirements: []
|
263
|
-
|
264
|
-
rubygems_version: 2.7.6
|
263
|
+
rubygems_version: 3.3.14
|
265
264
|
signing_key:
|
266
265
|
specification_version: 4
|
267
266
|
summary: Ruby library to use a Xapian db as a key/value store with high performance
|