Пример #1
0
 public AdminController(
     IFeedService feedService,
     IFeedMonitor feedMonitor,
     ApplicationDbContext applicationDbContext
     )
 {
     _feedService          = feedService;
     _feedMonitor          = feedMonitor;
     _applicationDbContext = applicationDbContext;
 }
Пример #2
0
        public FeedBackgroundService(IFeedService feedService, IConfiguration configuration, IFeedMonitor feedMonitor)
        {
            _feedMonitor = feedMonitor;
            _feedService = feedService;
            _log         = LogManager.GetLogger("Feeds");
            if (!TimeSpan.TryParse(configuration["Page2Feed:FeedCheckInterval"], out _feedCheckInterval))
            {
                throw new ArgumentException(
                          "Could not parse feed check interval",
                          "Page2Feed:FeedCheckInterval"
                          );
            }
#if DEBUG
            _feedCheckInterval = TimeSpan.FromSeconds(5);
#endif
            _feedMonitor.SetNextFeedCheck(DateTimeOffset.Now + _feedCheckInterval);
        }