Use variable for web request concurrency for clarity

This commit is contained in:
Dean Herbert 2019-06-10 13:52:09 +09:00
parent b79fdfc12f
commit e4bad93b66
1 changed files with 4 additions and 5 deletions

View File

@ -424,7 +424,9 @@ private class BeatmapUpdateQueue
{
private readonly IAPIProvider api;
private readonly ThreadedTaskScheduler updateScheduler = new ThreadedTaskScheduler(4);
private const int update_queue_request_concurrency = 4;
private readonly ThreadedTaskScheduler updateScheduler = new ThreadedTaskScheduler(update_queue_request_concurrency);
public BeatmapUpdateQueue(IAPIProvider api)
{
@ -455,10 +457,7 @@ private void perform(BeatmapInfo beatmap, CancellationToken cancellation)
beatmap.OnlineBeatmapID = res.OnlineBeatmapID;
};
req.Failure += e =>
{
Logger.Log($"Failed ({e})", LoggingTarget.Database);
};
req.Failure += e => { Logger.Log($"Failed ({e})", LoggingTarget.Database); };
// intentionally blocking to limit web request concurrency
req.Perform(api);