How to execute on start code in scala Play! framework application?

后端 未结 2 1832
余生分开走
余生分开走 2021-02-15 14:10

I need to execute a code allowing the launch of scheduled jobs on start of the application, how can I do this? Thanks.

2条回答
  •  轮回少年
    2021-02-15 14:37

    I was getting a similar error. Like @Leo said, create Global object in app/ directory.

    Only thing I had to make sure was to change "app: Application" to "app: play.api.Application".

    app: Application referred to class Application in controllers package.

提交回复
热议问题