File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -134,11 +134,15 @@ def setup
134
134
Elasticsearch ::Transport ::Transport ::Errors ::Conflict => e
135
135
error = JSON . parse ( e . message . gsub ( /\[ [0-9]{3}\] / , '' ) ) [ 'error' ] [ 'root_cause' ] . first
136
136
count += 1
137
+ raise e if count > 9
137
138
138
139
logger = Logger . new ( $stdout)
139
140
logger . error "#{ error [ 'type' ] } : #{ error [ 'reason' ] } "
140
- client . indices . delete ( index : error [ 'index' ] ) if error [ 'reason' ] =~ /index \[ .+\] already exists/
141
- raise e if count > 9
141
+ if error [ 'reason' ] =~ /index \[ .+\] already exists/
142
+ client . indices . delete ( index : error [ 'index' ] )
143
+ elsif ( model_id_match = /Trained machine learning model \[ ([a-z-0-9]+)\] already exists/ . match ( error [ 'reason' ] ) )
144
+ client . machine_learning . delete_trained_model ( model_id : model_id_match [ 1 ] )
145
+ end
142
146
143
147
sleep ( 1 )
144
148
redo
You can’t perform that action at this time.
0 commit comments