search-engine-for-typesense 30.1.8.12 → 30.1.8.13
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 680a9c687c571328d2ed1e521cb93b9a2d1962ec53bbeb7b315042015a150506
|
|
4
|
+
data.tar.gz: 64250ee42b7643fcdc3979a1e10c05d3d22bfcda11cf282dc1635566ca0f63e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f6a796bf120e04de8c2a55e4cf662b6e83b5f4a38b2e76315e0f8c79780d383d8f3673b65de5b1218ebfd36388f5dc47a08d385428a824ad26bedaddd09f4b8
|
|
7
|
+
data.tar.gz: 1837a2de35e82c7f7e7878eb39a6844d7b96d3767509a0c3829cc62fd12a126ff4f53d6284475c464e3db6c8395444065ac308d1ef673361f83ed33f97ead872
|
|
@@ -19,7 +19,7 @@ module SearchEngine
|
|
|
19
19
|
effective_limit = limit || SearchEngine.config.postgres_outbox.batch_size
|
|
20
20
|
drainer = drainer_for(target_key)
|
|
21
21
|
summary = drainer.drain_once(limit: effective_limit)
|
|
22
|
-
enqueue_continuation(limit: limit, target_key: target_key) if summary
|
|
22
|
+
enqueue_continuation(limit: limit, target_key: target_key) if continue_draining?(summary, effective_limit)
|
|
23
23
|
|
|
24
24
|
summary
|
|
25
25
|
end
|
|
@@ -31,6 +31,10 @@ module SearchEngine
|
|
|
31
31
|
{ claimed: 0, processed: 0, enqueued_targets: delivery_targets.size }
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
def continue_draining?(summary, effective_limit)
|
|
35
|
+
summary[:continue] || summary[:claimed].to_i >= effective_limit.to_i
|
|
36
|
+
end
|
|
37
|
+
|
|
34
38
|
def drainer_for(target_key)
|
|
35
39
|
return SearchEngine::PostgresOutbox::Drainer.new if target_key.nil?
|
|
36
40
|
|
|
@@ -31,6 +31,8 @@ module SearchEngine
|
|
|
31
31
|
summary = empty_summary(events)
|
|
32
32
|
next summary if events.empty?
|
|
33
33
|
|
|
34
|
+
summary[:continue] = true if continue_after_nonempty_target_batch?
|
|
35
|
+
|
|
34
36
|
kept, superseded_ids = coalesce(events)
|
|
35
37
|
repository.mark_superseded!(superseded_ids)
|
|
36
38
|
summary[:superseded] = superseded_ids.size
|
|
@@ -59,6 +61,10 @@ module SearchEngine
|
|
|
59
61
|
summary
|
|
60
62
|
end
|
|
61
63
|
|
|
64
|
+
def continue_after_nonempty_target_batch?
|
|
65
|
+
!target_key.nil?
|
|
66
|
+
end
|
|
67
|
+
|
|
62
68
|
def coalesce(events)
|
|
63
69
|
latest_by_key = {}
|
|
64
70
|
superseded = []
|