No description or website provided.
Scala Shell Batchfile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
conf
project
.gitignore
Procfile
README.md
app.json
build.sbt
sbt
sbt-launch.jar
sbt.bat

README.md

Simple Play 2 App with a Job

This example shows how to run a scheduled job in a Play app either in the web process or outside the web process (e.g. an external scheduler like Heroku's Scheduler Addon.

Running Locally

By default, when running the web app locally the Tick runs every second:

./sbt ~run

You should see "tick tock" every second in the STDOUT logs.

To run just a single Tick as a standalone process, run:

./sbt runMain jobs.TickJob

You should only see a single "tick tock" and then the process exits.

Running on Heroku

  1. Deploy on Heroku
  2. Open the Resources tab in your app's dashboard: https://dashboard.heroku.com/apps/YOUR APP NAME/resources
  3. Click on the Heroku Scheduler Add-on
  4. Add a new scheduled task with tick as the command / task name
  5. Check your app's logs to see the scheduled tick: https://dashboard.heroku.com/apps/YOUR APP NAME/logs