elastics-admin 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.5
1
+ 1.1.6
@@ -36,9 +36,20 @@ module Elastics
36
36
  unless Conf.redis.class.to_s == 'Redis'
37
37
  raise MissingAppIdError, 'You must set the Elastics::Configuration.app_id, and be sure you deploy it before live-reindexing.' \
38
38
  if Conf.app_id.nil? || Conf.app_id.empty?
39
- 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.) \
40
- if get(:pid)
41
- reset_keys # just in case
39
+
40
+ if get(:pid) && (pid = get(:pid).to_i)
41
+ message = begin
42
+ Process.kill(0, pid)
43
+ %(The live-reindex of "#{Conf.app_id}" is in progress (PID #{pid}).)
44
+ rescue Errno::ESRCH
45
+ # no process running (will reset_keys and continue)
46
+ rescue Exception
47
+ %(It looks like the live-reindex of "#{Conf.app_id}" is in progress (PID #{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.)
48
+ end
49
+ raise LiveReindexInProgressError, message if message
50
+ end
51
+
52
+ reset_keys
42
53
  set(:pid, $$)
43
54
  end
44
55
 
@@ -13,4 +13,4 @@ if redis_installed
13
13
  Elastics::Conf.redis = $redis || ::Redis.current
14
14
  end
15
15
 
16
- Elastics::Conf.optimize_indexing = true
16
+ Elastics::Conf.optimize_indexing = false
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.1.5
4
+ version: 1.1.6
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-09-23 00:00:00.000000000 Z
12
+ date: 2013-10-30 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.1.5
21
+ version: 1.1.6
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.1.5
29
+ version: 1.1.6
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