Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Play ws-scala服务器在120秒后根据请求挂起-使用哪些选项?_Scala_Web Services_Playframework - Fatal编程技术网

Play ws-scala服务器在120秒后根据请求挂起-使用哪些选项?

Play ws-scala服务器在120秒后根据请求挂起-使用哪些选项?,scala,web-services,playframework,Scala,Web Services,Playframework,我很确定这是一个配置问题,所以我将发布我的代码和我的play应用程序的相关application.conf选项 我有一个播放服务器,需要与另一个服务器“B”交互(基本上是多文件上传到B)。交互发生在一个异步操作中,这将导致上传时B的响应为OK。这是简化代码: def authenticateAndUpload( url: String) = Action.async( parse.multipartFormData) { implicit request => val form =

我很确定这是一个配置问题,所以我将发布我的代码和我的play应用程序的相关application.conf选项

我有一个播放服务器,需要与另一个服务器“B”交互(基本上是多文件上传到B)。交互发生在一个异步操作中,这将导致上传时B的响应为OK。这是简化代码:

def authenticateAndUpload( url: String) = Action.async( parse.multipartFormData) { implicit request =>
    val form = authForm.bindFromRequest.get
    val (user, pass) = (form.user, form.pass)
    //the whole following interaction with the other server happens in a future, i.e. login returns a Future[Option[WSCookie]] which is then used
    login(user, pass, url).flatMap {
      case Some(cookie) => //use the cookie to upload the files and collect the result, i.e. server responses
        //this may take a few minutes and happens in yet another future, which eventually produces the result
      result.map(cc => Ok(s"The server under url $url responded with $cc"))
      case None =>
        Future.successful(Forbidden(s"Unable to log into $url, please go back and try again with other credentials."))
    }
  }
我非常确信代码本身是有效的,因为我可以看到我的服务器日志,它每隔几秒钟就很好地打印B的响应,并继续进行,直到所有内容都正确上传。唯一的问题是浏览器在120秒后挂断服务器过载消息,这应该是一个播放默认值-,但对于哪个配置参数?

我试图通过设置every play.server.http来摆脱它。超时选项我可以得到我的手,甚至决定使用play.ws,特定的akka,和其他选项,我很确定他们是没有必要的。。。但是问题仍然存在,以下是我当前的application.config部分:

ws.timeout.idle="3600s"
ws.timeout.request ="3600s"
ws.timeout.response="3600s"

play.ws.timeout.idle="3600s"
play.ws.timeout.request="3600s"  
play.ws.timeout.response="3600s"

play.server.http.connectionTimeout="3600s"
play.server.http.idleTimeout="3600s"
play.server.http.requestTimeout="3600s"
play.server.http.responseTimeout="3600s"
play.server.http.keepAlive="true"

akka.http.host-connection-pool.idle-timeout="3600s"
akka.http.host-connection-pool.client.idle-timeout= "3600s"
浏览器挂断发生在Safari和Chrome上,Chrome在大约120秒后开始了与B的第二次通信——而且这两次通信都成功并生成了预期的日志,只有浏览器都挂断了

我在SBT环境中使用Scala 2.12.2和play 2.6.2,服务器正在开发中,预编译,但通过run启动-我了解到它可能不会选择application.conf选项-但它在一些文件大小定制上做到了。有人能告诉我正确的配置选项或我在运行过程中的错误吗