Ejemplo n.º 1
0
 public void UndoTaskTestBaseSetUp()
 {
     Cosmos    = new Mock <IPublishedFundingUndoCosmosRepository>();
     BlobStore = new Mock <IPublishedFundingUndoBlobStoreRepository>();
     ProducerConsumerFactory = new ProducerConsumerFactory();
     JobTracker = new Mock <IJobTracker>();
     Logger     = Serilog.Core.Logger.None;
 }
Ejemplo n.º 2
0
        public async Task Run(PublishedFundingUndoTaskContext taskContext)
        {
            LogStartingTask();

            Guard.ArgumentNotNull(taskContext?.PublishedFundingVersionDetails, nameof(taskContext.PublishedFundingVersionDetails));

            UndoTaskDetails details = taskContext.PublishedFundingVersionDetails;

            ICosmosDbFeedIterator <PublishedFundingVersion> feed = GetPublishedFundingVersionsFeed(details);

            FeedContext <PublishedFundingVersion> feedContext = new FeedContext <PublishedFundingVersion>(taskContext, feed);

            IProducerConsumer producerConsumer = ProducerConsumerFactory.CreateProducerConsumer(ProducePublishedFundingVersions,
                                                                                                UndoPublishedFundingVersions,
                                                                                                200,
                                                                                                4,
                                                                                                Logger);

            await producerConsumer.Run(feedContext);

            await NotifyJobProgress(taskContext);

            LogCompletedTask();
        }