小编vir*_*hah的帖子

SpringBoot GraphQL请求执行超时问题

我已经将 Spring boot 与 graphQL(版本 11.1.0)一起使用,它工作正常,但当请求执行时间超过 30 秒时,它会抛出超时错误。

错误:

GraphQL execution canceled because timeout of 30000 millis was reached. The following query was being executed when this happened:
// query
Cannot write GraphQL response, because the HTTP response is already committed. It most likely timed out.
Run Code Online (Sandbox Code Playgroud)

谁能告诉我如何在 graphQL 中配置超时?

java spring-boot graphql

4
推荐指数
1
解决办法
3900
查看次数

将此“ yyyy-MM-dd'T'HH:mm:ss.SSSXXX”格式的字符串转换为LocalDate

我想将字符串日期(指定了时区)转换为LocalDate。

String format = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX";
String date = "2019-08-31T17:00:00.000-07:00";

System.out.println("LocalDate: " + LocalDate.parse(date, DateTimeFormatter.ofPattern(format)));
System.out.println("Date: " + new SimpleDateFormat(format).parse(date));
Run Code Online (Sandbox Code Playgroud)

上面代码的输出是

LocalDate: 2019-08-31
Date: Sun Sep 01 05:30:00 IST 2019
Run Code Online (Sandbox Code Playgroud)

我无法获得与SimpleDateFormat相同的结果。我想要LocalDate中的2019-09-01。

java simpledateformat java-8 localdate

2
推荐指数
1
解决办法
569
查看次数