首页 > 解决方案 > 使用neo4j数据库访问API时,30000毫秒内重试6次失败

问题描述

最初,当我使用 neo4j 数据库访问 API 时,它可以正常工作,但一段时间后,当我尝试访问 API 时,出现以下错误:

Failed after retried for 6 times in 30000 ms. Make sure that your database is online and retry again.

我在 API 中使用下面的代码进行数据库连接:

var neo4jClient = new BoltGraphClient(new Uri(connectionUrl), Username, Password);
neo4jClient.ConnectAsync();
services.AddSingleton<IBoltGraphClient>(neo4jClient);

标签: asp.net-coreneo4jgraph-databasesneo4jclient

解决方案


这里没有真正的编码答案,唯一让我印象深刻的是在通话await之前缺乏。neo4jClient.ConnectAsync()

除此之外,您需要检查连接、网络等。如果它是本地的 - 那我不确定 - 我想你可以尝试/抓住这个 - 但这就是幕后发生的事情。


推荐阅读