Esempio n. 1
0
 public void ExpectPartialResult(Guid mainScheduledJobId, Guid scheduledJobId, TimeSpan timeout)
 {
     lock (this._syncRoot)
     {
         List <PartialDiscoveryResultsContainer.PartialResult> partialResultList;
         if (!this._resultsByMainJobId.TryGetValue(mainScheduledJobId, out partialResultList))
         {
             throw new ArgumentException("Results with given main result ID are not in container.", nameof(mainScheduledJobId));
         }
         PartialDiscoveryResultsContainer.PartialResult partialResult = new PartialDiscoveryResultsContainer.PartialResult(scheduledJobId, mainScheduledJobId, this._persistenceStore, this._dateTimeProvider().Add(timeout));
         partialResultList.Add(partialResult);
         this._resultsByOwnJobId[partialResult.JobId] = partialResult;
     }
 }
Esempio n. 2
0
 public void CreatePartialResult(
     Guid scheduledJobId,
     OrionDiscoveryJobResult result,
     SortedDictionary <int, List <IDiscoveryPlugin> > orderedPlugins,
     JobState jobState)
 {
     if (result == null)
     {
         throw new ArgumentNullException(nameof(result));
     }
     PartialDiscoveryResultsContainer.PartialResult partialResult = new PartialDiscoveryResultsContainer.PartialResult(scheduledJobId, scheduledJobId, orderedPlugins, jobState, result.get_ProfileId(), this._persistenceStore, DateTime.MaxValue)
     {
         Result = result
     };
     lock (this._syncRoot)
     {
         this._resultsByMainJobId[partialResult.JobId] = new List <PartialDiscoveryResultsContainer.PartialResult>();
         this._resultsByMainJobId[partialResult.JobId].Add(partialResult);
         this._resultsByOwnJobId[partialResult.JobId] = partialResult;
     }
 }