GlobalSettings onStart fires only after first request

后端 未结 2 863
忘掉有多难
忘掉有多难 2021-01-13 16:29

I need to run some code only once when I starts the play server. When using the GlobalSettings.OnStart() I notice that the code is executed only after the first (http) reque

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-13 16:56

    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.

提交回复
热议问题