jamesward/play2-scheduled-job-demo — pull request #5 by mbseid (2014-04-17 11:19:19+00:00)
Title: Need to also stop our play server once we are done

This little change caught me pretty badly in my most recent Heroku app. You must stop your Play instance if you want the Heroku dyno to turn off once your done with your job.

Without stopping the app, the background dyno will run 24/7, as there is no end to the application. It just runs until the next tick of the job.

One caution: be mindful of async tasks and other futures. You need to wait and make sure they are all done before calling the Play.stop() command.