Unverified Commit 3ad1e4a3 authored by Fabien Viale's avatar Fabien Viale Committed by GitHub
Browse files

Merge pull request #3776 from fviale/master

Generic Info REMOVE_DELAY : change format
parents dab65419 5af14e6b
......@@ -575,7 +575,6 @@ public class SchedulingService {
boolean shouldRemoveFromDb = PASchedulerProperties.JOB_REMOVE_FROM_DB.getValueAsBoolean();
if (tempJobs.size() == 1) {
logger.info("Job " + jobId + " will be removed at " + new Date(at));
infrastructure.getDBManager().scheduleJobForRemoval(tempJobs.get(0).getJobInfo().getJobId(),
at,
shouldRemoveFromDb);
......@@ -964,7 +963,7 @@ public class SchedulingService {
}
if (jobGenericInfo != null && jobGenericInfo.containsKey(GENERIC_INFO_REMOVE_DELAY)) {
try {
removeDelay = Tools.formatDate(jobGenericInfo.get(GENERIC_INFO_REMOVE_DELAY));
removeDelay = Tools.parsePeriod(jobGenericInfo.get(GENERIC_INFO_REMOVE_DELAY));
} catch (Exception e) {
logger.error("Error when parsing generic information " + GENERIC_INFO_REMOVE_DELAY + " for job " +
jobId, e);
......@@ -974,6 +973,7 @@ public class SchedulingService {
// auto remove
if (removeDelay < Long.MAX_VALUE) {
long timeToRemove = System.currentTimeMillis() + removeDelay;
jlogger.info(jobId, "Job " + jobId + " will be removed at " + new Date(timeToRemove));
scheduleJobRemove(jobId, timeToRemove);
}
} catch (Throwable t) {
......@@ -1015,7 +1015,7 @@ public class SchedulingService {
if (job.getGenericInformation() != null &&
job.getGenericInformation().containsKey(GENERIC_INFO_REMOVE_DELAY)) {
try {
toWait = Tools.formatDate(job.getGenericInformation().get(GENERIC_INFO_REMOVE_DELAY));
toWait = Tools.parsePeriod(job.getGenericInformation().get(GENERIC_INFO_REMOVE_DELAY));
} catch (Exception e) {
logger.error("Error when parsing generic information " + GENERIC_INFO_REMOVE_DELAY +
" for job " + job.getId(), e);
......
......@@ -4,7 +4,7 @@
name="Job_houseKeeping_with_GI" priority="normal">
<description>Simple Job</description>
<genericInformation>
<info name="REMOVE_DELAY" value="1:00"/>
<info name="REMOVE_DELAY" value="1m"/>
</genericInformation>
<taskFlow>
<task name="task1">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment