Merge f667780a27 into 5e593dd096
This commit is contained in:
commit
5a17d10ad4
1 changed files with 12 additions and 2 deletions
|
|
@ -278,8 +278,18 @@ class GraphitiService:
|
||||||
# Re-raise other errors
|
# Re-raise other errors
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# Build indices
|
# Build indices - wrap in try/except to handle Neo4j 5.x race condition
|
||||||
await self.client.build_indices_and_constraints()
|
# with parallel IF NOT EXISTS index creation
|
||||||
|
try:
|
||||||
|
await self.client.build_indices_and_constraints()
|
||||||
|
except Exception as idx_error:
|
||||||
|
if 'EquivalentSchemaRuleAlreadyExists' in str(idx_error):
|
||||||
|
logger.warning(
|
||||||
|
'Index creation race condition detected (Neo4j 5.x issue). '
|
||||||
|
'Indexes likely already exist. Continuing...'
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
logger.info('Successfully initialized Graphiti client')
|
logger.info('Successfully initialized Graphiti client')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue