Skip to content

Commit

Permalink
[playframework#7] play status now resolves cron-pattern from applicat…
Browse files Browse the repository at this point in the history
…ion.conf if starting with 'cron.'
  • Loading branch information
mbknor committed Mar 22, 2011
1 parent 8818dc9 commit 72d6701
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions framework/src/play/jobs/JobsPlugin.java
Expand Up @@ -57,8 +57,13 @@ public String getStatus() {
out.print(" run at application start" + (appStartAnnotation.async()?" (async)" : "") + ".");
}

if (job.getClass().isAnnotationPresent(On.class)) {
out.print(" run with cron expression " + job.getClass().getAnnotation(On.class).value() + ".");
if( job.getClass().isAnnotationPresent(On.class)) {

String cron = job.getClass().getAnnotation(On.class).value();
if (cron != null && cron.startsWith("cron.")) {
cron = Play.configuration.getProperty(cron);
}
out.print(" run with cron expression " + cron + ".");
}
if (job.getClass().isAnnotationPresent(Every.class)) {
out.print(" run every " + job.getClass().getAnnotation(Every.class).value() + ".");
Expand Down

0 comments on commit 72d6701

Please sign in to comment.