elastic_manager 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/elastic_manager.gemspec +1 -1
- data/lib/elastic_manager/request.rb +9 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb139beb6d9318303760c37ccc6c1e84b06e25f66933858c8f9eaeb40e05f4b9
|
4
|
+
data.tar.gz: 985de58d74f0be96016a3acdacc05823d780250cd445506338dbb12962414bc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9cf6bb907c0417266ef9a1403a0f95392adad759a84677076352046d4960467ed9ac9de2894c073cb29c8747afef959cf59b6dd7a4ea48c139948e3e0436a8d
|
7
|
+
data.tar.gz: 62abeb754c6c9031384b6289a147a43e115f2138aecde7bc44318e43a6314ba698258b0b918d81618593a2a49a21a302bcc0131d8040a88af21f4ca43fa19360
|
data/elastic_manager.gemspec
CHANGED
@@ -200,12 +200,12 @@ module Request
|
|
200
200
|
if snapshot['state'] == 'SUCCESS'
|
201
201
|
snapshot['snapshot']
|
202
202
|
else
|
203
|
-
log.
|
204
|
-
|
203
|
+
log.error 'wrong snapshot state'
|
204
|
+
return false
|
205
205
|
end
|
206
206
|
else
|
207
|
-
log.
|
208
|
-
|
207
|
+
log.error "can't find snapshot #{snapshot_name} in #{repo} response was: #{response.code} - #{response}"
|
208
|
+
false
|
209
209
|
end
|
210
210
|
end
|
211
211
|
|
@@ -214,6 +214,8 @@ module Request
|
|
214
214
|
snapshot_repo = find_snapshot_repo
|
215
215
|
snapshot = find_snapshot(snapshot_repo, snapshot_name)
|
216
216
|
|
217
|
+
return false unless snapshot
|
218
|
+
|
217
219
|
body = {
|
218
220
|
index_settings: {
|
219
221
|
'index.number_of_replicas' => 0,
|
@@ -227,8 +229,8 @@ module Request
|
|
227
229
|
sleep 5
|
228
230
|
wait_snapshot_restore(index)
|
229
231
|
else
|
230
|
-
log.
|
231
|
-
|
232
|
+
log.error "can't restore snapshot #{snapshot_name} response was: #{response.code} - #{response}"
|
233
|
+
false
|
232
234
|
end
|
233
235
|
end
|
234
236
|
|
@@ -241,7 +243,7 @@ module Request
|
|
241
243
|
|
242
244
|
if response.code == 200
|
243
245
|
# TODO: (anton.ryabov) add logging of percent and time ?
|
244
|
-
restore_ok = json_parse(response)[index]['shards'].map { |s| s['stage'] == 'DONE' }.all?{ |a| a
|
246
|
+
restore_ok = json_parse(response)[index]['shards'].map { |s| s['stage'] == 'DONE' }.all? { |a| a }
|
245
247
|
else
|
246
248
|
log.error "can't check recovery: #{response.code} - #{response}"
|
247
249
|
end
|