使用neo4j数据库访问API时30000毫秒重试6次失败 [英] Failed after retried for 6 times in 30000 ms when accessing API with neo4j database
问题描述
最初,当我使用 neo4j 数据库访问 API 时,它工作正常,但一段时间后,当我尝试访问 API 时,出现以下错误:
Initially when I accessing the API with neo4j database it works properly but after some time when I try to access the API I got the error below:
Failed after retried for 6 times in 30000 ms. Make sure that your database is online and retry again.
我在 API 中使用以下代码进行数据库连接:
I am using the code below for database connection in API:
var neo4jClient = new BoltGraphClient(new Uri(connectionUrl), Username, Password);
neo4jClient.ConnectAsync();
services.AddSingleton<IBoltGraphClient>(neo4jClient);
推荐答案
这里没有真正的编码答案,唯一让我印象深刻的是在 neo4jClient 之前缺少
调用.await
.ConnectAsync()
There's no real coding answer here, the only thing that sticks out to me is a lack of await
before the neo4jClient.ConnectAsync()
call.
除此之外,您还需要检查连接、网络等.如果它是本地的——那么我不确定——我想你可以尝试/抓住这个——但这就是幕后发生的事情.
Other than that, you'd need to check the connection, network etc. If it's local - then I'm not sure - I guess you can try/catch this - but that's kind of what has happened under the hood.
这篇关于使用neo4j数据库访问API时30000毫秒重试6次失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!