elastics-admin 1.0.9 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.9
1
+ 1.0.10
@@ -39,7 +39,7 @@ module Elastics
39
39
  end
40
40
  raise MissingAppIdError, 'You must set the Elastics::Configuration.app_id, and be sure you deploy it before live-reindexing.' \
41
41
  if Conf.app_id.nil? || Conf.app_id.empty?
42
- raise LiveReindexInProgressError, %(It looks like a live-reindex is in progress (PID #{get(:pid)}). If you are sure that there is no live-reindex in progress, please run the "elastics:reset_redis_keys" rake task and retry.) \
42
+ raise LiveReindexInProgressError, %(It looks like the live-reindex of "#{Conf.app_id}" is in progress (PID #{get(:pid)}). If you are sure that there is no live-reindex in progress, please run the "elastics:admin:reset_redis_keys APP_ID=#{Conf.app_id}" rake task and retry.) \
43
43
  if get(:pid)
44
44
  reset_keys # just in case
45
45
  set(:pid, $$)
@@ -168,7 +168,7 @@ module Elastics
168
168
  @stop_indexing.call
169
169
  Prompter.say_notice 'Indexing stopped.' if opts[:verbose]
170
170
  else
171
- Prompter.say_warning 'No on_stop_indexing provided!' if opts[:verbose]
171
+ Prompter.say_notice 'No on_stop_indexing provided.' if opts[:verbose]
172
172
  end
173
173
 
174
174
  # if we have still changes, we can index them all, now that the indexing is stopped
@@ -205,7 +205,7 @@ module Elastics
205
205
  end
206
206
 
207
207
  def index_changes(opts)
208
- left_changes_count = Redis.llen(:changes)
208
+ left_changes_count = Redis.llen(:changes) || 0
209
209
  return if left_changes_count == 0
210
210
 
211
211
  batch_size = opts[:batch_size] || 100
data/lib/tasks.rake CHANGED
@@ -12,6 +12,12 @@ namespace :elastics do
12
12
  desc 'Loads a dumpfile into Elasticsearch'
13
13
  task(:load => env) { Elastics::Admin::Tasks.new.load_from_file }
14
14
 
15
+ task(:reset_redis_keys) do
16
+ return unless Elastics::Conf.redis
17
+ ekeys = Elastics::LiveReindex::Redis::KEYS
18
+ ekeys.keys.each { |k| Elastics::Conf.redis.del "#{ekeys[k]}-#{ENV['APP_ID']}" }
19
+ end
20
+
15
21
  end
16
22
 
17
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastics-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-27 00:00:00.000000000 Z
12
+ date: 2013-09-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: elastics-client
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.0.9
21
+ version: 1.0.10
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.0.9
29
+ version: 1.0.10
30
30
  description: Provides binary and rake tasks to dump, load and optionally rename indices.
31
31
  Implements live-reindex with hot-swap of old code/index with new code/index.
32
32
  email: dd.nexus@gmail.com