Fixed issue 30837.Added contains check in ImportEntryProcessor
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Wed, 16 Sep 2015 16:14:51 +0200
changeset 27591 0e91bbf913d3
parent 27590 a5246165806e
child 27592 68dbc59de475
Fixed issue 30837.Added contains check in ImportEntryProcessor

Check if the import entry id is already in the runnable entry list before
calling the addEntry method.
src/org/openbravo/service/importprocess/ImportEntryProcessor.java
--- a/src/org/openbravo/service/importprocess/ImportEntryProcessor.java	Thu Sep 17 16:36:15 2015 +0000
+++ b/src/org/openbravo/service/importprocess/ImportEntryProcessor.java	Wed Sep 16 16:14:51 2015 +0200
@@ -163,9 +163,11 @@
     // waiting to be processed, but not yet started
     if (runnable != null) {
       // there is runnable which can handle this ImportEntry
-      if (log.isDebugEnabled()) {
-        log.debug("Adding entry to runnable with key " + key);
+      if (runnable.importEntryIds.contains(importEntry.getId())) {
+        // already queued
+        return;
       }
+      log.debug("Adding entry to runnable with key " + key);
       // give it to the runnable
       runnable.addEntry(importEntry);