Skip to content

Commit

Permalink
Disable APIResponseColumn insertion
Browse files Browse the repository at this point in the history
- Disable API Response Column insertion to prevent OR from crashing/hanging when very large API Response columns are generated.
- Consider adding optional flag to enable in settings.
  • Loading branch information
glassjoseph committed Sep 23, 2021
1 parent 55f4d5b commit 7728c33
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ public void run() {
List<CellAtRow> links = new ArrayList<CellAtRow>(items.size());
List<CellAtRow> responses = new ArrayList<CellAtRow>(items.size());

// Disable API Response // TODO: Add settings flag to allow API Response
Boolean includeAPIResponseColumn = false;

for (int i = 0; i < items.size(); i++) {
SNACUploadItem item = items.get(i);
int row = item.rowIndex();
Expand All @@ -103,7 +106,9 @@ public void run() {
messages.add(new CellAtRow(row, new Cell(uploadResponse.getMessage(), null)));
ids.add(new CellAtRow(row, new Cell(uploadResponse.getIDString(), null)));
links.add(new CellAtRow(row, new Cell(uploadResponse.getURI(), null)));
responses.add(new CellAtRow(row, new Cell(uploadResponse.getAPIResponse(), null)));
if (includeAPIResponseColumn ) {
responses.add(new CellAtRow(row, new Cell(uploadResponse.getAPIResponse(), null)));
}

_progress = i * 100 / items.size();

Expand Down Expand Up @@ -154,7 +159,9 @@ public void run() {
addHistoryEntry(messageColumn, messages);
addHistoryEntry(idColumn, ids);
addHistoryEntry(uriColumn, links);
addHistoryEntry(responseColumn, responses);
if (includeAPIResponseColumn ) {
addHistoryEntry(responseColumn, responses);
}

_project.processManager.onDoneProcess(this);
}
Expand Down

0 comments on commit 7728c33

Please sign in to comment.