예제 #1
0
 public CsvExport(
     ILogger <CsvExport> logger
     , IMonitoredPostRepository repo
     , IOptions <CsvExportConfiguration> config
     , IMapper mapper
     )
 {
     _logger = logger;
     _repo   = repo;
     _config = config.Value;
     _mapper = mapper;
 }
예제 #2
0
 public PostUpdater(ILogger <PostUpdater> logger
                    , IOptions <UpdaterConfiguration> configOption
                    , IMonitoredPostRepository repo
                    , IRedditClientWrapper clientWrapper
                    )
 {
     _logger           = logger;
     _config           = configOption.Value;
     _repo             = repo;
     _clientWrapper    = clientWrapper;
     _configPostMaxAge = TimeSpan.Parse(_config.MaxPostAge, new CultureInfo("en-US"));
     _logger.LogInformation("Post will be monitored for [{MonitoredTime}]", _configPostMaxAge);
     _clientWrapper.ConnectivityUpdated += ConnectivityUpdated;
 }
예제 #3
0
 public PostPoller(
     ILogger <PostPoller> logger
     , IHostApplicationLifetime applicationLifetime
     , IOptions <PollerConfiguration> config
     , IMonitoredPostRepository monitoredPostRepository
     , IRedditClientWrapper redditClientWrapper
     , IWatchedSubRedditRepository watchedSubRedditRepository
     )
 {
     _logger = logger;
     _applicationLifetime        = applicationLifetime;
     _pollerConfig               = config.Value;
     _monitoredPostRepository    = monitoredPostRepository;
     _watchedSubRedditRepository = watchedSubRedditRepository;
     _redditClientWrapper        = redditClientWrapper;
     _redditClientWrapper.ConnectivityUpdated += ConnectivityUpdated;
     _newPostMaxAge      = TimeSpan.FromMinutes(_pollerConfig.NewPostMaxAgeInMinutes);
     _subRedditWatchTime = TimeSpan.FromHours(_pollerConfig.SubRedditWatchTimeInHours);
 }