コード例 #1
0
        // PerformContext context is passed in via Hangfire Server
        public async Task Run(PerformContext context)
        {
            LogInfo(context, "Starting reporting data refresh job");

            try
            {
                LogInfo(context, "Starting migration uspGenerate");
                var stepOneResults =
                    await _externalStoredProcedureRepository.ExecuteMigrationGenerateStoredProcedure();

                AssertSuccessfulExecution(context, stepOneResults);

                LogInfo(context, "Starting specimen-matching uspGenerate");
                var stepTwoResults =
                    await _externalStoredProcedureRepository.ExecuteSpecimenMatchingGenerateStoredProcedure();

                AssertSuccessfulExecution(context, stepTwoResults);

                LogInfo(context, "Starting reporting uspGenerate");
                var stepThreeResults =
                    await _externalStoredProcedureRepository.ExecuteReportingGenerateStoredProcedure();

                AssertSuccessfulExecution(context, stepThreeResults);
            }
            catch (Exception ex)
            {
                context.WriteLine(ex.Message);
                Log.Error(ex, "Error occured during reporting data refresh job");
                throw;
            }

            LogInfo(context, "Finishing reporting data refresh job");
        }
コード例 #2
0
        // PerformContext context is passed in via Hangfire Server
        public async Task Run(PerformContext context)
        {
            LogInfo(context, "Starting generate reporting data job");

            try
            {
                LogInfo(context, "Starting reporting uspGenerate");
                var results = await _externalStoredProcedureRepository.ExecuteReportingGenerateStoredProcedure();

                AssertSuccessfulExecution(context, results);
            }
            catch (Exception ex)
            {
                context.WriteLine(ex.Message);
                Log.Error(ex, "Error occurred during generate reporting data job");
                throw;
            }

            LogInfo(context, "Finishing generate reporting data job.");
        }