private async Task updateStatsAsync()

in DIXFSamples/RecurringIntegrationApp/Runtime/DefaultDataFlowNetwork.cs [470:523]


        private async Task updateStatsAsync(DataJobStatusDetail jobStatusDetail, 
            StatType statusType, 
            ClientDataMessage targetDataMessage,
            HttpResponseMessage httpResponse = null)
        {
            switch(statusType)
            {
                case StatType.Success:

                    // Write log
                    await writeStatusLogFileAsync(jobStatusDetail, targetDataMessage, httpResponse);

                    // Update stats
                    Interlocked.Increment(ref successfulJobCount);

                    Interlocked.Decrement(ref inprocessJobCount);

                    base.formInstance.updateStats(StatType.Success, successfulJobCount);

                    base.formInstance.updateStats(StatType.Inprocess, inprocessJobCount);

                    base.formInstance.logText("Processing completed successfully for job: " + targetDataMessage.Name);

                    break;

                case StatType.Failure:

                    // Write log
                    await writeStatusLogFileAsync(jobStatusDetail, targetDataMessage, httpResponse);

                    // Update stats
                    Interlocked.Increment(ref failedJobCount);

                    Interlocked.Decrement(ref inprocessJobCount);

                    base.formInstance.updateStats(StatType.Failure, failedJobCount);

                    base.formInstance.updateStats(StatType.Inprocess, inprocessJobCount);

                    if (null == jobStatusDetail)
                    {
                        // Enqueue failed
                        base.formInstance.logText(string.Format("File: {0} -  moved to error location.", targetDataMessage.Name));
                    }
                    else
                    {
                        // Enqueue was successful, but failure processing data
                        base.formInstance.logText("Processing completed with errors for job: " + targetDataMessage.Name);
                    }
                    
                    break;
            }
            
        }