Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play Framework 2 only recompiles at first request

I am using PlayFramwework 2.1.1 with Scala and I have created a small test server that I run locally (play run from console). If I change something while the server is running, these changes won't be recompiled and "re-deployed" until the first request hits (curl "http://localhost:9000", for example).

Is there a way to have the server refresh upon save, like on Tomcat? Thanks.

like image 888
ticofab Avatar asked Dec 27 '22 02:12

ticofab


2 Answers

Yep. Start it with play ~run. (notice the tilde.) That way, files will automatically be recompiled after saving them.

like image 165
Carsten Avatar answered Jan 15 '23 23:01

Carsten


That's common usage case

play run waits for request to compile changes (so compiles at the first request right after changes)

play ~run after change saving

Keep in mind that goes with price increased memory and CPU consumption, so while developemnt is not always desired situation.

like image 24
biesior Avatar answered Jan 16 '23 01:01

biesior