Hi All! Good Morning!
The system was developed in C#. The system tries to retrieve the event frames for all elements on the same level of the hierarchy. There are 72 elements and 277 event frames are expected on this 3 months search period.
The system throws an error when using batch to get all elements and then get all event frames:
System.AggregateException HResult=0x80131500 Message=One or more errors occurred. (A task was canceled.) Source=System.Private.CoreLib StackTrace: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task`1.get_Result() at PILibrary.Controllers.PILibraryController.ReadExperimentsRuns2(String siteName, String bioreactorClass, DateTime periodStartDate, DateTime periodEndDate) in D:\TQS\repos\pilibrary\PILibrary\Controllers\PISDKInterfaceController.cs:line 2444 Inner Exception 1: TaskCanceledException: A task was canceled.
When limiting the query to first result the system returns correct information with no error.
An alternative method was created to query all elements, create a list of webIDs an than perform a for loop to get event frames for each event frame, but this method is taking up to 17 minutes to finish.
When using parallel.for or paralle.foreach the system towns the following error:
System.AggregateException HResult=0x80131500 Message=One or more errors occurred. (A task was canceled.) Source=System.Private.CoreLib StackTrace: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task`1.get_Result() at PILibrary.Controllers.PILibraryController.<>c__DisplayClass56_1.<ReadExperimentsRuns>b__0(Int32 l) in D:\TQS\repos\pilibrary\PILibrary\Controllers\PISDKInterfaceController.cs:line 2145 at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) Inner Exception 1: TaskCanceledException: A task was canceled.
Any suggestions?
Thanks in advance