public SubscriberThread(ResourceStore <Subscription> resourceStore, SubscriberSettings settings)
 {
     this.resourceStore        = resourceStore;
     this.settings             = settings;
     this.statisticsDataSender = new DataSender <ItemModel>(settings.StatisticsUrl);
     random = new Random();
 }
        public static SubscriberSettings ReadSettings()
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                          .AddEnvironmentVariables();
            IConfigurationRoot configuration = builder.Build();
            var settings = new SubscriberSettings();

            configuration.GetSection("Settings").Bind(settings);

            return(settings);
        }