private async Task OnStarting() { var startupService = Container.Resolve <StartupCheckingService>(); var context = Container.Resolve <CryptoGramBotDbContext>(); await DbInitializer.Initialize(context); var limiterTotal = new RateLimiterPerEndpoint(1, TimeSpan.FromSeconds(1)); var limiterPerEndpoint = new RateLimiterPerEndpoint(1, TimeSpan.FromSeconds(1)); BittrexDefaults.AddDefaultRateLimiter(limiterTotal); BittrexDefaults.AddDefaultRateLimiter(limiterPerEndpoint); startupService.Start(); }
private async Task OnStarting() { var startupService = Container.Resolve <StartupCheckingService>(); var context = Container.Resolve <CryptoGramBotDbContext>(); await DbInitializer.Initialize(context); var limiterTotal = new RateLimiterPerEndpoint(1, TimeSpan.FromSeconds(1)); var limiterPerEndpoint = new RateLimiterPerEndpoint(1, TimeSpan.FromSeconds(1)); BittrexClient.SetDefaultOptions(new BittrexClientOptions { RateLimiters = new List <IRateLimiter> { limiterTotal, limiterPerEndpoint } }); startupService.Start(); }