public void Run()
        {
            logger.LogInformation("Starting background jobs");
            IGetSetQuerier <PackageDetails> querier = new RedisGetSetQuery <PackageDetails>(CreatePackagesDbConnection(), Constants.Redis.PackageKeyForName);

            this.jobQueue.DoTo(q => CategoriesController.KeyPackageNames.Select(n => { q.EnqueueJob(n); return(true); }).ToArray());
            new BackgroundJobListener(timerProvider, CreatePackagesDbConnection(), Constants.Redis.PackageCrawlerJobQueueName)
            .ListenWith(new Crawler(querier, new NuspecDownloader(), new JobQueue(CreatePackagesDbConnection(), Constants.Redis.DownloadStatsCheckerQueue)).CrawlProject);
            new BackgroundJobListener(timerProvider, CreatePackagesDbConnection(), Constants.Redis.DownloadStatsCheckerQueue)
            .ListenWith(new DownloadStatsChecker(
                            new RedisGetSetQuery <Package>(CreatePackagesDbConnection(), Constants.Redis.PackageKeyForName),
                            new RedisGetSetQuery <Stats>(CreatePackagesDbConnection(), Constants.Redis.PackageKeyForName),
                            new DownloadStatsCheck()).LoadStats);
            new BackgroundJobListener(timerProvider, CreatePackagesDbConnection(), Constants.Redis.PackageVersionsCrawlerJob)
            .ListenWith(new VersionHistoryChecker(
                            new RedisGetSetQuery <VersionsList>(CreatePackagesDbConnection(), Constants.Redis.PackageKeyForName), new VersionHistoryCheck()).LoadVersionHistory);
        }
Example #2
0
 public RedisGetSetQueryTest()
 {
     subject = new RedisGetSetQuery <Package>(mockRedisDatabase.Object, Constants.Redis.PackageKeyForName);
 }