Skip to content

v0.2.52..v0.2.53 changeset JobRunnable.java

Garret Voltz edited this page Feb 12, 2020 · 1 revision
diff --git a/hoot-services/src/main/java/hoot/services/job/JobRunnable.java b/hoot-services/src/main/java/hoot/services/job/JobRunnable.java
index c6b5332..ad01b6b 100644
--- a/hoot-services/src/main/java/hoot/services/job/JobRunnable.java
+++ b/hoot-services/src/main/java/hoot/services/job/JobRunnable.java
@@ -22,7 +22,7 @@
  * This will properly maintain the copyright information. DigitalGlobe
  * copyrights will be updated automatically.
  *
- * @copyright Copyright (C) 2016, 2017, 2019 DigitalGlobe (http://www.digitalglobe.com/)
+ * @copyright Copyright (C) 2016, 2017, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/)
  */
 package hoot.services.job;
 
@@ -81,7 +81,10 @@ class JobRunnable implements Runnable {
                 CommandResult result = command.execute();
 
                 if (result.failed()) {
-                    jobStatusManager.setFailed(job.getJobId(), "Command with ID = " + result.getId() + " caused the failure.");
+                    //Cancelled jobs also have non-zero exit code, but should not be marked FAILED
+                    if (!JobStatus.CANCELLED.equals(jobStatusManager.getJobStatusObj(job.getJobId()).getStatus())) {
+                        jobStatusManager.setFailed(job.getJobId(), "Command with ID = " + result.getId() + " caused the failure.");
+                    }
                     break;
                 }
                 else {
@@ -95,7 +98,9 @@ class JobRunnable implements Runnable {
             jobStatusManager.setCompleted(job.getJobId(), "FULLY PROCESSED");
 
             if(job.getJobType().equals(JobType.UPLOAD_CHANGESET)){
-                DbUtils.setStale(job.getTags().get("parentId"));
+                String parentId = job.getTags().get("parentId");
+                DbUtils.setStale(parentId);
+                DbUtils.checkConflicted(job.getJobId(), parentId);
             }
         }
         catch (Exception e) {
Clone this wiki locally