You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/04/08 23:35:34 UTC

svn commit: r1311107 - /ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java

Author: jleroux
Date: Sun Apr  8 21:35:34 2012
New Revision: 1311107

URL: http://svn.apache.org/viewvc?rev=1311107&view=rev
Log:
Oops, I committed the wrong file at r1311082, reverting

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=1311107&r1=1311106&r2=1311107&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 Sun Apr  8 21:35:34 2012
@@ -208,7 +208,6 @@ public class JobManager {
     public synchronized void reloadCrashedJobs() {
         String instanceId = UtilProperties.getPropertyValue("general.properties", "unique.instanceId", "ofbiz0");
         List<GenericValue> crashed = null;
-        List<GenericValue> pending = null;
 
         List<EntityExpr> exprs = UtilMisc.toList(EntityCondition.makeCondition("runByInstanceId", instanceId));
         exprs.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "SERVICE_RUNNING"));
@@ -220,41 +219,10 @@ public class JobManager {
             Debug.logError(e, "Unable to load crashed jobs", module);
         }
 
-        exprs = UtilMisc.toList(EntityCondition.makeCondition("runByInstanceId", instanceId));
-        exprs.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "SERVICE_PENDING"));
-        ecl = EntityCondition.makeCondition(exprs);
-
-        try {
-            pending = delegator.findList("JobSandbox", ecl, null, UtilMisc.toList("startDateTime"), null, false);
-        } catch (GenericEntityException e) {
-            Debug.logError(e, "Unable to load pending jobs", module);
-        }
-
-
         if (UtilValidate.isNotEmpty(crashed)) {
             try {
                 int rescheduled = 0;
                 for (GenericValue job: crashed) {
-                    
-                    // We don't reload a crashed job if a pending job with same service name and 
-                    //    recurrenceInfoId or tempExprId  exists
-                    String serviceName = job.getString("serviceName");
-                    String recurrenceInfoId = job.getString("recurrenceInfoId");
-                    String tempExprId = job.getString("tempExprId");
-                    if (UtilValidate.isNotEmpty(pending)) {
-                        for (GenericValue parentJob: pending) {
-                            String parentServiceName = parentJob.getString("serviceName");
-                            String parentRecurrenceInfoId = parentJob.getString("recurrenceInfoId");
-                            String parentTempExprId = parentJob.getString("tempExprId");
-                            if (serviceName.equals(parentServiceName)
-                                    && recurrenceInfoId.equals(parentRecurrenceInfoId) || tempExprId.equals(parentTempExprId)) {
-                                continue;
-                            }
-                        }
-                    }
-
-                    if (0 == job.getLong("maxRetry").longValue()) continue;
-
                     Timestamp now = UtilDateTime.nowTimestamp();
                     Debug.log("Scheduling Job : " + job, module);