Hardened against transient broadcast failure

This commit is contained in:
Rick Falkvinge
2019-03-04 07:08:05 +01:00
parent 75c0e86785
commit 9548c02009
6 changed files with 77 additions and 21 deletions
+9 -1
View File
@@ -71,12 +71,20 @@ namespace Swarmops.Logic.Support
// Run the Run() function
bool transientError = false;
try
{
Console.WriteLine(" - Executing BSO: " + className);
order.Run();
}
catch (TryAgainException)
{
transientError = true;
// Don't close this backend service order - it will retry
}
catch (Exception exception)
{
if (!order.HasWorkerThread)
@@ -88,7 +96,7 @@ namespace Swarmops.Logic.Support
}
finally
{
if (!order.HasWorkerThread)
if (!order.HasWorkerThread && !transientError)
{
try
{