예제 #1
0
        public StatsManager(HttpClient httpClient)
        {
            _httpClient = httpClient;
            _logger     = DicordLogFactory.GetLogger <StatsManager>(GlobalVariables.DiscordId, GlobalVariables.DiscordToken);

            WebHookClient.RateLimitMs = 1000;
        }
예제 #2
0
        public StartupService(IConfigurationRoot config, IStellarService stellarService)
        {
            //DatabaseQueueService databaseQueueService
            _config         = config;
            _stellarService = stellarService;

            _logger = DicordLogFactory.GetLogger <StartupService>(GlobalVariables.DiscordId, GlobalVariables.DiscordToken);
        }
예제 #3
0
        static Startup()
        {
            ILoggerRepository logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

            XmlConfigurator.Configure(logRepository, new FileInfo("Kin.Horizon.Api.Poller.dll.config"));

            Logger = DicordLogFactory.GetLogger <Startup>(GlobalVariables.DiscordId, GlobalVariables.DiscordToken);
        }
예제 #4
0
        public static void Main(string[] args)
        {
            ConfigurationBuilder builder = new ConfigurationBuilder();

            builder.AddInMemoryCollection(GlobalVariables.DefaultConfiguration).AddCommandLine(args).AddEnvironmentVariables();
            var configuration = builder.Build();

            GlobalVariables.DiscordId    = long.Parse(configuration["DiscordLogger:Id"]);
            GlobalVariables.DiscordToken = configuration["DiscordLogger:Token"];

            var logger = DicordLogFactory.GetLogger <Program>(GlobalVariables.DiscordId, GlobalVariables.DiscordToken);

            logger.LogInformation("Entered Main Entry Point");
            Startup.RunAsync(configuration).Wait();
            logger.LogInformation("Exiting Main Entry Point");
        }
예제 #5
0
        public StellarService(IConfigurationRoot config, HttpClient httpClient, StatsManager statsManager)
        {
            _statsManager   = statsManager;
            _config         = config;
            _queueNotifier1 = new AutoResetEvent(false);
            _httpClient     = httpClient;

            _logger = DicordLogFactory.GetLogger <StellarService>(GlobalVariables.DiscordId, GlobalVariables.DiscordToken);
            _operationsToHandleQueue = new ConcurrentQueue <OperationResponse>();
            ServicePointManager.DefaultConnectionLimit = 100;
            _logger.LogInformation($"Stellar service is using endpoint {_config["StellarService:HorizonHostname"]}");
            _server = new Server(_config["StellarService:HorizonHostname"]);
            Network.UsePublicNetwork();

            _startTime = new Stopwatch();
            var queueThread = new Task(HandleResponseQueue, TaskCreationOptions.LongRunning);

            queueThread.Start();

            _timer          = new System.Timers.Timer(50);
            _timer.Elapsed += Timer_tick;
            _timer.Enabled  = true;
            _timer.Start();
        }