Skip to content

Instantly share code, notes, and snippets.

@evanc
Created January 4, 2017 21:59
Show Gist options
  • Save evanc/68c8894e476f27e54286512dd0eb186d to your computer and use it in GitHub Desktop.
Save evanc/68c8894e476f27e54286512dd0eb186d to your computer and use it in GitHub Desktop.
diff --git a/bpo/src/main/com/paloalto/bpo/worker/ImageWorker.java b/bpo/src/main/com/paloalto/bpo/worker/ImageWorker.java
index 317e36e..bb184b2 100644
--- a/bpo/src/main/com/paloalto/bpo/worker/ImageWorker.java
+++ b/bpo/src/main/com/paloalto/bpo/worker/ImageWorker.java
@@ -126,8 +126,6 @@ public class ImageWorker extends AbstractQueueWorker implements Runnable {
eventTracker.trackEvent(data);
}
- currentJob.setCurrentStatus(ImageUploadStatus.SUCCESS);
-
log.debug("Finished processing image job");
commitTransaction();
@@ -163,6 +161,13 @@ public class ImageWorker extends AbstractQueueWorker implements Runnable {
}
}
+ while (imageManager.getImageFile(fileName).getHeight() == 0) {
+ Thread.sleep(10);
+ }
+
+ // This needs to run after the information has finished writing to the database
+ currentJob.setCurrentStatus(ImageUploadStatus.SUCCESS);
+
log.warn("Finished image job");
clearLoggingUser();
}else{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment