コード例 #1
0
 public RabbitMQReceiver(IConfiguration cfg,
                         cvConfig cvConfiguration,
                         ImportScrapeData importData)
 {
     this.cfg             = cfg;
     this.cvConfiguration = cvConfiguration;
     this.importData      = importData;
 }
コード例 #2
0
 public NewScrapeFileListener(RMQMessage options,
                              ImportScrapeData importData,
                              cvConfig cvConfiguration,
                              IConfiguration cfg) : base(options)
 {
     this.cfg             = cfg;
     this.cvConfiguration = cvConfiguration;
     this.importData      = importData;
 }
コード例 #3
0
        public ScrapeFileWatcherReceive(RabbitContext ctx,
                                        ImportScrapeData importData,
                                        cvConfig cvConfig) : base(ctx)
        {
            this._cvConfig   = cvConfig;
            this._importData = importData;
            var scrapeDataMessage = new CoronaVirusScrapeDataMessage();

            ctx.Binder.RoutingKey = scrapeDataMessage.RoutingKey;
            this.Register();
        }
コード例 #4
0
 public FileWatcherConsole(CvContext ctx,
                           IConfiguration cfg,
                           ImportScrapeData importData,
                           cvParsers cvParsers,
                           cvConfig cvConfiguration)
 {
     this.ctx             = ctx;
     this.cfg             = cfg;
     this.importData      = importData;
     this.cvParsers       = cvParsers;
     this.cvConfiguration = cvConfiguration;
 }
コード例 #5
0
        public ScrapeFileImport(CvContext ctx,
                                IConfiguration cfg,
                                cvParsers parsers,
                                ImportScrapeData importer,
                                cvConfig cvConfiguration)
        {
            this.ctx             = ctx;
            this.cfg             = cfg;
            this.parsers         = parsers;
            this.importer        = importer;
            this.cvConfiguration = cvConfiguration;

            runtest = new ScrapeRunsTest(ctx, cfg, parsers, cvConfiguration);
        }
コード例 #6
0
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            while (!stoppingToken.IsCancellationRequested)
            {
                using var scope = _serviceScopeFactory.CreateScope();
                var cfg   = scope.ServiceProvider.GetRequiredService <IConfiguration>();
                var cvCfg = scope.ServiceProvider.GetRequiredService <cvConfig>();
                var cvp   = scope.ServiceProvider.GetRequiredService <cvParsers>();
                var dbCtx = scope.ServiceProvider.GetRequiredService <CvContext>();
                var imp   = new ImportScrapeData(dbCtx, cvp, cvCfg);
                _consumer = new apiDataReceiver(_ctxLocal);
                _consumer.Run();

                await Task.Delay(TimeSpan.FromDays(1), stoppingToken);
            }
        }
コード例 #7
0
 public ImportRunner(ImportScrapeData importData, cvConfig cvConfig)
 {
     _cvConfig        = cvConfig;
     this._importData = importData;
 }