From b68e227a8365c3d6132e2908f14ce9c381903341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20=C3=96ner?= Date: Wed, 6 Jan 2021 00:24:54 +0300 Subject: [PATCH] Update RestClient.cs --- CryptoExchange.Net/RestClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CryptoExchange.Net/RestClient.cs b/CryptoExchange.Net/RestClient.cs index d3372fa..bc8bdd5 100644 --- a/CryptoExchange.Net/RestClient.cs +++ b/CryptoExchange.Net/RestClient.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -172,7 +172,7 @@ namespace CryptoExchange.Net /// [return: NotNull] protected virtual async Task> SendRequest(Uri uri, HttpMethod method, CancellationToken cancellationToken, - Dictionary? parameters = null, bool signed = false, bool checkResult = true, PostParameters? postPosition = null, ArrayParametersSerialization? arraySerialization = null) where T : class + Dictionary? parameters = null, bool signed = false, bool checkResult = true, PostParameters? postPosition = null, ArrayParametersSerialization? arraySerialization = null, int credits=1) where T : class { var requestId = NextId(); log.Write(LogVerbosity.Debug, $"[{requestId}] Creating request for " + uri); @@ -185,7 +185,7 @@ namespace CryptoExchange.Net var request = ConstructRequest(uri, method, parameters, signed, postPosition ?? postParametersPosition, arraySerialization ?? this.arraySerialization, requestId); foreach (var limiter in RateLimiters) { - var limitResult = limiter.LimitRequest(this, uri.AbsolutePath, RateLimitBehaviour); + var limitResult = limiter.LimitRequest(this, uri.AbsolutePath, RateLimitBehaviour, credits); if (!limitResult.Success) { log.Write(LogVerbosity.Debug, $"[{requestId}] Request {uri.AbsolutePath} failed because of rate limit");