ts-sidekiq-delta 0.3.0 → 0.4.0

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: 0a34f8c20bb7dd19b659c3102c1ce469f0a774b16802f72fc3d48c28ee7095cc
4
- data.tar.gz: 88ba8dd20506b3e103aa96b44ce684f91df76135026bc367c56002bb5050ab17
3
+ metadata.gz: 34668cf810659d724a770fabad19841b92e40cb06f22d79f5df942e6d4c7bb15
4
+ data.tar.gz: 0fa4dac9ab3ebfc622b439f6a3d84abe702e0a22613dc318d77531180439295f
5
5
  SHA512:
6
- metadata.gz: 4a2933c6c6123d71f535360795d394a39106fa9addf8f6f9c1a17b0d68f9dbf5e33c4da19effd520036da9950495719dc3b6c1cbcab039b1cee1a0f0e33b1ab7
7
- data.tar.gz: '029b98245027eb02d4d151b3545bd41e00b982fb84d2b5a2532393e7ac52a4acd37d00d745357295b107bc41b43bcff497838a61fe4f3486f3733864deb6cce0'
6
+ metadata.gz: 4af5489c0957f6b9e75d2903c42c20d6ad17dd46d206cbaf26fe0fce03307645a7373e272d433ed02a56bfcea922d33b8c062f2cf4ed00db9d980182df540d2a
7
+ data.tar.gz: 36af1174a628ed52eca178d64842123543d4c55e67aaba6d158bf5711277952374ad46385882c5e85964dfa9a711baaf9f70aee22409c9f020dca4cef0e148f4
data/README.markdown CHANGED
@@ -8,7 +8,7 @@ This version of `ts-sidekiq-delta` works only with [Thinking Sphinx](https://git
8
8
 
9
9
  Get it into your Gemfile - and don't forget the version constraint!
10
10
 
11
- gem 'ts-sidekiq-delta', '~> 0.3.0'
11
+ gem 'ts-sidekiq-delta', '~> 0.4.0'
12
12
 
13
13
  If you're using Thinking Sphinx v3.0.x, you'll need to jump back to the 0.1.0 release of this gem.
14
14
 
@@ -37,4 +37,4 @@ Make sure you have a sidekiq worker monitoring the `ts_delta` queue.
37
37
 
38
38
  ## Licence
39
39
 
40
- Copyright (c) 2013, ts-sidekiq-delta was originally developed by Danny Hawkins, is currently maintained by Pat Allan, and is released under the open MIT Licence.
40
+ Copyright (c) 2013-2021, ts-sidekiq-delta was originally developed by Danny Hawkins, is currently maintained by Pat Allan, and is released under the open MIT Licence.
@@ -3,7 +3,7 @@
3
3
  class ThinkingSphinx::Deltas::SidekiqDelta::DeltaJob
4
4
  include Sidekiq::Worker
5
5
 
6
- sidekiq_options lock: :until_executed, retry: true, queue: 'ts_delta', unique_prefix: 'tsdelta'
6
+ sidekiq_options lock: :until_executed, retry: true, queue: 'ts_delta', lock_prefix: 'tsdelta'
7
7
 
8
8
  # Runs Sphinx's indexer tool to process the index.
9
9
  #
@@ -3,7 +3,7 @@ class ThinkingSphinx::Deltas::SidekiqDelta::FlagAsDeletedJob
3
3
 
4
4
  # Runs Sphinx's indexer tool to process the index. Currently assumes Sphinx
5
5
  # is running.
6
- sidekiq_options lock: :until_executed, retry: true, queue: 'ts_delta', unique_prefix: "tsflagasdeleted"
6
+ sidekiq_options lock: :until_executed, retry: true, queue: 'ts_delta', lock_prefix: "tsflagasdeleted"
7
7
 
8
8
  def perform(index, document_id)
9
9
  ThinkingSphinx::Deltas::DeleteJob.new(index, document_id).perform
@@ -28,7 +28,7 @@ describe 'SQL delta indexing', :live => true do
28
28
 
29
29
  Book.search('Harry').to_a.should == [book]
30
30
 
31
- book.reload.update_attributes(:author => 'Terry Pratchett')
31
+ book.reload.update!(:author => 'Terry Pratchett')
32
32
  work
33
33
  sleep 0.25
34
34
 
@@ -41,7 +41,7 @@ describe 'SQL delta indexing', :live => true do
41
41
 
42
42
  Book.search('Harry').to_a.should == [book]
43
43
 
44
- book.reload.update_attributes(:author => 'Terry Pratchett')
44
+ book.reload.update!(:author => 'Terry Pratchett')
45
45
  work
46
46
  sleep 0.25
47
47
 
@@ -3,9 +3,7 @@ RSpec.configure do |config|
3
3
  DatabaseCleaner.strategy = :truncation
4
4
  end
5
5
 
6
- config.after(:each) do
7
- if example.example_group_instance.class.metadata[:live]
8
- DatabaseCleaner.clean
9
- end
6
+ config.after(:each, :live) do
7
+ DatabaseCleaner.clean
10
8
  end
11
9
  end
@@ -7,13 +7,6 @@ class SphinxController
7
7
  FileUtils.mkdir_p config.indices_location
8
8
  config.render_to_file && index
9
9
 
10
- ThinkingSphinx::Configuration.reset
11
- ActiveSupport::Dependencies.clear
12
-
13
- config.index_paths.each do |path|
14
- Dir["#{path}/**/*.rb"].each { |file| $LOADED_FEATURES.delete file }
15
- end
16
-
17
10
  config.searchd.mysql41 = 9307
18
11
  config.settings['quiet_deltas'] = true
19
12
  config.settings['attribute_updates'] = true
@@ -14,10 +14,11 @@ module SphinxHelpers
14
14
  end
15
15
 
16
16
  def work
17
- client = Redis.connect(:url => "resque://localhost:6379/")
17
+ client = Redis.new(:url => "redis://localhost:6379/")
18
18
  namespace = Redis::Namespace.new('test', :redis => client)
19
19
 
20
- Sidekiq::Client.registered_queues.each do |queue_name|
20
+ queues = namespace.sscan_each("queues").to_a
21
+ queues.each do |queue_name|
21
22
  while message = namespace.lpop("queue:#{queue_name}")
22
23
  message = JSON.parse(message)
23
24
  message['class'].constantize.new.perform(*message['args'])
@@ -1,3 +1,5 @@
1
1
  class Book < ActiveRecord::Base
2
- #
2
+ ThinkingSphinx::Callbacks.append(
3
+ self, :behaviours => [:sql, :deltas]
4
+ )
3
5
  end
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'ts-sidekiq-delta'
4
- s.version = '0.3.0'
4
+ s.version = '0.4.0'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Pat Allan', 'Aaron Gibralter', 'Danny Hawkins']
7
7
  s.email = ['pat@freelancing-gods.com', 'danny.hawkins@gmail.com']
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.add_dependency 'thinking-sphinx', '>= 3.1.0'
19
19
  s.add_dependency 'sidekiq', '>= 2.5.4'
20
- s.add_dependency 'sidekiq-unique-jobs', '>= 6.0.0'
20
+ s.add_dependency 'sidekiq-unique-jobs', '>= 7.0.0'
21
21
 
22
22
  s.add_development_dependency 'activerecord', '>= 3.1.0'
23
23
  s.add_development_dependency 'combustion'
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ts-sidekiq-delta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
8
8
  - Aaron Gibralter
9
9
  - Danny Hawkins
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-05-07 00:00:00.000000000 Z
13
+ date: 2021-12-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thinking-sphinx
@@ -46,14 +46,14 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 6.0.0
49
+ version: 7.0.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 6.0.0
56
+ version: 7.0.0
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: activerecord
59
59
  requirement: !ruby/object:Gem::Requirement
@@ -216,7 +216,7 @@ homepage: https://github.com/pat/ts-sidekiq-delta
216
216
  licenses:
217
217
  - MIT
218
218
  metadata: {}
219
- post_install_message:
219
+ post_install_message:
220
220
  rdoc_options: []
221
221
  require_paths:
222
222
  - lib
@@ -231,8 +231,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  - !ruby/object:Gem::Version
232
232
  version: '0'
233
233
  requirements: []
234
- rubygems_version: 3.0.3
235
- signing_key:
234
+ rubygems_version: 3.2.32
235
+ signing_key:
236
236
  specification_version: 4
237
237
  summary: Thinking Sphinx - Sidekiq Deltas
238
238
  test_files: