Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Simple Play 1.2.4 App with a Job

This little app shows how you can do simple one-off and scheduled jobs within Play 1.2.4 apps on Heroku. These jobs run in separate processes from the Play 1 web server.

Running Locally

export DATABASE_URL=postgres://f:f@localhost/f
play start --%prod
java -Dapplication.path=. -DlogLevel=INFO -Dprecompiled=true -cp lib/*:conf:~/play-1.2.4/framework/play-1.2.4.jar:~/play-1.2.4/framework/lib/*:tmp/classes jobs.HelloJob .

Running on Heroku

Clone this project locally:

$ git clone git://

In the play1-scheduled-job-demo directory, create a new app on Heroku (make sure you have the Heroku Toolbelt installed):

$ heroku login
$ heroku create

Push the app to Heroku:

git push heroku master

Verify that it works:

heroku open

Run a one-off HelloJob:

heroku run hello

Add the Scheduler add-on:

heroku addons:add scheduler:standard

Open the Scheduler add-on console:

heroku addons:open scheduler

Add a new scheduled task with hello as the command / task name. Set the desired frequency. Save the scheduled task and either wait for it to run or manually run it from the Scheduler add-on console.

Something went wrong with that request. Please try again.