GlobalSettings onStart fires only after first request

本秂侑毒 提交于 2019-12-01 06:53:04

That is the behavior when the application is in development mode, play run. When it's running in production mode, play start, then your onStart method will run immediately when the application starts prior to any requests.

You can emulate that (or I should say, workaround this unfortunate dichotomous design), by using this plugin, which, I find useful also in general:

addSbtPlugin("com.jamesward" % "play-auto-refresh" % "0.0.11") (plugins.sbt)

And no, it is not really currently documented in any right place, that this is how OnStart works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!