Exemple #1
0
 public MatrixSyncHostService(
     ILogger <MatrixSyncHostService> logger,
     IMatrixDataCache matrixDataCache,
     ScopedDbContextFactory dbContextFactory
     )
 {
     _logger           = logger;
     _matrixDataCache  = matrixDataCache;
     _dbContextFactory = dbContextFactory;
 }
Exemple #2
0
 public NodeSynchronizer(
     IOptions <NodeSyncSettings> settingsOptions,
     ILocateIpService locationCaller,
     INeoJsonRpcService rPCNodeCaller,
     ScopedDbContextFactory scopeFactory,
     INodeDataCache nodeDataCache,
     IRawMemPoolDataCache rawMemPoolDataCache
     )
 {
     _locateIpService     = locationCaller;
     _rpcService          = rPCNodeCaller;
     _nodeSyncSettings    = settingsOptions.Value;
     _dbContextFactory    = scopeFactory;
     _nodeDataCache       = nodeDataCache;
     _rawMemPoolDataCache = rawMemPoolDataCache;
 }
Exemple #3
0
            public async ValueTask OnUpdateAsync(ScopedDbContextFactory factory, DateTime date)
            {
                if (IsCacheEmpty)
                {
                    return;
                }
                var dataOfYesterday = ReplaceCacheAndReturnOld();

                using var wrapper = factory.CreateDbContextScopedWrapper <AnalysisDbContext>();
                var context = wrapper.Context;
                await context.IpVisitors.AddRangeAsync(dataOfYesterday.Select(p => new IpVisitAnaData()
                {
                    Ip    = p.Key,
                    Times = p.Value,
                    Day   = date.Day,
                    Hour  = date.Hour
                }));

                await context.SaveChangesAsync();
            }
 public NodeSeedsStartupFilter(ScopedDbContextFactory dbcontextFactory, INodeSeedsLoaderFactory dataLoader)
 {
     _dbcontextFactory = dbcontextFactory;
     _dataLoader       = dataLoader;
 }
Exemple #5
0
 public IpVisitorService(ScopedDbContextFactory scopeFactory)
 {
     _scopeFactory = scopeFactory;
 }