14

我正在使用 Scala 编译服务器。这可能与我的 IDE IntelliJ IDEA 无关,但我只会通知您,我通过该 IDE 中的特殊运行配置启动 Scala 编译服务器。

经过一段时间没有编译任何东西后,编译服务器终止,没有任何消息。通常,我只有在尝试编译某些东西并且编译失败时才会注意到这一点。然后,我需要重新启动编译服务器,当然下一次编译需要很长时间,因为这又是启动编译服务器后的第一次编译。

如何关闭该超时?我查看了 scalac 的联机帮助页,似乎没有选择。我可以为该运行配置添加 VM 选项。

4

2 回答 2

6

我不认为你可以。这是来自编译服务器的代码片段:

object SocketServer
{
  // After 30 idle minutes, politely exit.
  // Should the port file disappear, and the clients
  // therefore unable to contact this server instance,
  // the process will just eventually terminate by itself.
  val IdleTimeout = 1800000
  val BufferSize  = 10240

  def bufferedReader(s: Socket) = new BufferedReader(new InputStreamReader(s.getInputStream()))
  def bufferedOutput(s: Socket) = new BufferedOutputStream(s.getOutputStream, BufferSize)
}

我认为您应该在 scala-lang.org 中打开一个功能请求

于 2010-12-13T14:37:48.200 回答
6

-max-idle 0作为参数传递。它将在非常(非常!)最近的每晚上运行,并且它应该在 Scala 2.9.0 上可用。但是,不能保证在此之前名称不会改变。

于 2011-03-21T15:03:46.923 回答