Author: nmalin
Date: Mon Jan  4 09:46:42 2016
New Revision: 1722816

URL: http://svn.apache.org/viewvc?rev=1722816&view=rev
Log:
When ofbiz reload crashed jobs when it start, replay only one time the crashed 
jobs. Remove all temporal information to ensure that the new job don't create 
any reccurent schedule that duplicate the origin job's configuration, See 
OFBIZ-6784, thanks Scott to spot the good correction

Modified:
    ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java

Modified: 
ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java?rev=1722816&r1=1722815&r2=1722816&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java 
(original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java Mon 
Jan  4 09:46:42 2016
@@ -300,7 +300,7 @@ public final class JobManager {
             Timestamp now = UtilDateTime.nowTimestamp();
             for (GenericValue job : crashed) {
                 try {
-                    Debug.logInfo("Scheduling Job : " + job, module);
+                    if (Debug.infoOn()) Debug.logInfo("Scheduling Job : " + 
job, module);
                     String pJobId = job.getString("parentJobId");
                     if (pJobId == null) {
                         pJobId = job.getString("jobId");
@@ -312,6 +312,9 @@ public final class JobManager {
                     newJob.set("parentJobId", pJobId);
                     newJob.set("startDateTime", null);
                     newJob.set("runByInstanceId", null);
+                    //don't set a recurrent schedule on the new job, run it 
just one time
+                    newJob.set("tempExprId", null);
+                    newJob.set("recurrenceInfoId", null);
                     delegator.createSetNextSeqId(newJob);
                     // set the cancel time on the old job to the same as the 
re-schedule time
                     job.set("statusId", "SERVICE_CRASHED");


Reply via email to