
works.lmz.jobs.periodic.ScheduledJobEvent.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of periodic-jobs Show documentation
Show all versions of periodic-jobs Show documentation
Simple scheduler for periodic jobs. Requires Spring.
The newest version!
package works.lmz.jobs.periodic
import java.text.SimpleDateFormat
class ScheduledJobEvent {
static SimpleDateFormat df = new SimpleDateFormat('yyyy-MM-dd HH:mm:ss')
Date start
Date finish
Throwable error
String getLogMessage(){
if (error){
return "${df.format(start)} - job has resulted in ${error.class.simpleName}: ${error.getMessage()} at ${df.format(finish)}"
}else if (finish == null){
return "${df.format(start)} - job is still running..."
}else{
return "${df.format(start)} - ${df.format(finish)}"
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy