要增加 Apollo GraphQL 服务器的 Keep-Alive 超时时间,可以在创建服务器时传递一个配置对象作为参数。如下所示:
const server = new ApolloServer({ typeDefs, resolvers, // 增加 Keep-Alive 超时时间为 120 秒 keepAliveTimeout: 120000 });
这里将 Keep-Alive 超时时间设置为 120 秒,也可以根据需要进行调整。
上一篇:ApolloGraphql返回结果而不发送请求
下一篇:ApolloGraphQL服务器中的解析器链是如何工作的?