File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -137,16 +137,22 @@ async def index_entities(
137
137
try :
138
138
docs = iter_entity_docs (updater , next_index )
139
139
await provider .bulk_index (docs )
140
- except YenteIndexError as exc :
140
+ except (YenteIndexError , Exception ) as exc :
141
+ detail = getattr (exc , "detail" , str (exc ))
141
142
log .exception (
142
- "Indexing error: %s" % exc . detail ,
143
+ "Indexing error: %s" % detail ,
143
144
dataset = dataset .name ,
144
145
index = next_index ,
145
146
)
146
147
aliases = await provider .get_alias_indices (alias )
147
148
if next_index not in aliases :
148
149
log .warn ("Deleting partial index" , index = next_index )
149
150
await provider .delete_index (next_index )
151
+ if updater .is_incremental and not force :
152
+ # This is tricky: try again with a full reindex if the incremental
153
+ # indexing failed
154
+ log .warn ("Retrying with full reindex" , dataset = dataset .name )
155
+ return await index_entities (provider , dataset , force = True )
150
156
raise exc
151
157
152
158
await provider .refresh (index = next_index )
You can’t perform that action at this time.
0 commit comments