值流不是播放框架2.6.0中Application.this.Status的成员

时间:2019-02-07 10:12:07

标签: playframework playframework-2.6

我使用的是Play框架版本2.4.3,然后将其升级到2.6.0,我遇到了编译错误

myproject/app/controllers/Application.scala:146: value stream is not a member of Application.this.Status
[error]     Ok.stream(responseStream).withHeaders("Content-Type" -> TextFormat.CONTENT_TYPE_004)
[error]        ^

这是破坏代码

def prometheusMetrics = Action {
    val responseStream = Concurrent.unicast[Array[Byte]] { channel =>
      val writer = new WriterAdapter(channel)
      TextFormat.write004(writer, CollectorRegistry.defaultRegistry.metricFamilySamples())
      writer.close()
    }
    Ok.stream(responseStream).withHeaders("Content-Type" -> TextFormat.CONTENT_TYPE_004)
  }

此代码在play 2.6中如何工作?

0 个答案:

没有答案
相关问题