Skip to content

Commit

Permalink
Fix performance issue with unavailable projects.
Browse files Browse the repository at this point in the history
Instead of just re-throwing the exception, we now log a meaningful message. The previous approach of an uncaught exception caused huge CPU performance issues (up to 100% CPU usage if multiple projects were not accessible).
Note: Don't use uncaught exceptions to control program flow ... :/
  • Loading branch information
steffen-wilke committed Feb 11, 2020
1 parent 5890655 commit 2b0c7a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Soloplan.WhatsON/SerializationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ public async Task<TModel> GetJsonModel<TModel>(string requestUrl, CancellationTo
throw new OperationCanceledException(ex.Message, ex, token);
}

throw;
log.Error($"Could not fetch JSON data from {requestUrl}.", ex);
return null;
}
}

Expand Down

0 comments on commit 2b0c7a3

Please sign in to comment.