Phil
Phil

Reputation: 50446

Play app does not seem to start unless I http to it, how can I make it start otherwise?

I have a Scala Play application with a Global which starts Actors. The problem is that the Global.onStart method does not get called until I go to my browser and http : / / l o c a l h o s t:9000/ which is the URL to my Play Framework Application. I would like it to start immediately when my application starts.

The Global is like this https://github.com/ndeverge/twivent/blob/master/app/Global.scala

Documentation on Global is here http://www.playframework.com/documentation/2.0/ScalaGlobal

Upvotes: 0

Views: 31

Answers (1)

Donovan Muller
Donovan Muller

Reputation: 3842

When Play is run in development mode, i.e. with play and then run or ~run it will start when the first request is received. See here

When you run in production mode (i.e. with start or from a dist build of your app) it will start immediately and will not check for changes before each request.

Upvotes: 1

Related Questions