Пример #1
0
        public Guid ExecuteJobImmediately(Job query)
        {
            var jobHistoryItem = CreateJobHistoryItem(query);

            _jobHistoryStore.AddJobHistoryItem(jobHistoryItem);
            var jobStatusTracker = _jobStatusTrackerFactory.GetTracker(_jobHistoryStore, jobHistoryItem);

            Task.Run(() => _importRunner.ReadFromDatabase(query, jobHistoryItem.ProgressMonitor, jobStatusTracker));
            return(jobHistoryItem.Id);
        }
Пример #2
0
        public Guid ExecuteJobImmediately(Job query)
        {
            var jobHistoryItem = CreateJobHistoryItem(query);

            _jobHistoryStore.AddJobHistoryItem(jobHistoryItem);
            var jobStatusTracker = _jobStatusTrackerFactory.GetTracker(_jobHistoryStore, jobHistoryItem);

            using (var cancellationTokenSource = new CancellationTokenSource())
            {
                Task.Run(() => _importRunner.RunElasticSearchPipeline(query, jobStatusTracker));
            }
            return(jobHistoryItem.Id);
        }