public RealTimeHistoricDbService(
        IRtConnector connector,
        IHistoricRepository repository,
        ILoggerFactory loggerFactory,
        ProcessInfoStatistics processInfo,
        IOptions <RealTimeHistoricDBConfiguration> options)
    {
        this.logger           = loggerFactory.CreateLogger(nameof(WorkerService));
        this.connector        = connector;
        this.repository       = repository;
        this.processInfo      = processInfo;
        this.wsTags           = new Queue <List <TagChangeTracker> >();
        this.tagChangeManager = new TagChangeTrackerManager();
        this.lastCommit       = DateTime.Now;

        var intervalRefresh = options.Value.CheckTagChangeIntervalMilliseconds ?? 1000;
        var intervalCommit  = options.Value.SaveChangeIntervalSeconds ?? 5 * 60;

        this.checkTagChangeInterval = TimeSpan.FromMilliseconds(intervalRefresh > 100 ? intervalRefresh : 100);
        this.saveChangeInterval     = TimeSpan.FromSeconds(intervalCommit > 2 ? intervalCommit : 2);

        this.daysPresistence = options.Value.DaysPresistence ?? 30;

        logger.LogInformation("Initialize RealTimeHistoricDbWorker, checkTagChangeInterval time:{checkTagChangeInterval} " +
                              "saveChangeInterval time:{saveChangeInterval} daysPresistence:{daysPresistence}",
                              checkTagChangeInterval, saveChangeInterval, daysPresistence);
    }
예제 #2
0
 public SeedData(
     ApplicationDbContext dbContext,
     IClubRepository clubRepository,
     IPlayerRepository playerRepository,
     IHistoricRepository historicRepository)
 {
     _dbContext          = dbContext;
     _clubRepository     = clubRepository;
     _playerRepository   = playerRepository;
     _historicRepository = historicRepository;
 }
예제 #3
0
 public PeopleRepository(AppDbContext context, IHistoricRepository historicRepository)
 {
     this.context            = context;
     this.historicRepository = historicRepository;
 }
 public HistoricController(IHistoricRepository historicRepository)
 {
     this.historicRepository = historicRepository;
 }