Skip to content

Commit

Permalink
Potential fix for FindRelated prematurely halting on error
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewstellman committed Aug 31, 2019
1 parent f0f4c2e commit e617bc7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions FindRelated/RelatedFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,19 @@ struct RankAndScore
}
}
if (failed)
{
Trace.WriteLine(DateTime.Now + " - successfully recovered from the error, continuing execution");
}
else
{
Dictionary<int, List<int>> relatedSearchResults = GetIdsFromXml(xml, out Dictionary<int, Dictionary<int, RankAndScore>> relatedRanks);

Dictionary<int, List<int>> relatedSearchResults = GetIdsFromXml(xml, out Dictionary<int, Dictionary<int, RankAndScore>> relatedRanks);

bool completed;
bool completed;

completed = WriteRelatedRanksToOutputFileAndDatabase(db, relatedTableName, relatedSearchResults, relatedRanks, outputFilename, inputQueue);
if (!completed) // WriteRelatedRankToOutputFile() returns false if the user stopped the operation
break;
completed = WriteRelatedRanksToOutputFileAndDatabase(db, relatedTableName, relatedSearchResults, relatedRanks, outputFilename, inputQueue);
if (!completed) // WriteRelatedRankToOutputFile() returns false if the user stopped the operation
break;
}
}
BackgroundWorker.ReportProgress(100);
}
Expand Down

0 comments on commit e617bc7

Please sign in to comment.