Add CancellationToken to GetRatesAsync and propagate it from the controllers to the rate fetcher

This commit is contained in:
nicolas.dorier
2019-03-05 17:09:17 +09:00
parent 9a239f99f4
commit 051248f2fc
25 changed files with 104 additions and 79 deletions

View File

@@ -181,7 +181,7 @@ namespace BTCPayServer.Controllers
try
{
cts.CancelAfter(TimeSpan.FromSeconds(5));
var result = await RateFetcher.FetchRate(currencyPair, rateRules).WithCancellation(cts.Token);
var result = await RateFetcher.FetchRate(currencyPair, rateRules, cts.Token).WithCancellation(cts.Token);
if (result.BidAsk != null)
{
model.Rate = result.BidAsk.Center;