Skip to content

Commit

Permalink
Import task, import modules before declaring missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Puckfist committed Dec 6, 2016
1 parent 2f7a554 commit 419016d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Core/src/com/serotonin/m2m2/web/dwr/emport/ImportTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public ProcessResult getResponse() {

private int importerIndex;
private boolean importerSuccess;
private boolean importedItems;

@Override
protected void runImpl() {
Expand All @@ -129,14 +130,29 @@ protected void runImpl() {
// them again.
importerIndex = 0;
importerSuccess = false;
}
else {
} else if(!importedItems) {
try {
for (ImportItem importItem : importItems) {
if (!importItem.isComplete()) {
importItem.importNext(importContext);
return;
}
}
importedItems = true; // We may have imported a dependency in a module
importerIndex = 0;
}
catch (Exception e) {
addException(e);
}
} else {
// There are importers left in the list, but there were no successful imports in the last run
// of the set. So, all that is left is stuff that will always fail. Copy the validation
// messages to the context for each.
// Run the import items.
for (Importer importer : importers)
importer.copyMessages();
importers.clear();
completed = true;
return;
}
}
Expand Down

0 comments on commit 419016d

Please sign in to comment.