Exemple #1
0
        private async Task <VostokApplicationRunResult> RunApplicationAsync()
        {
            log.Info("Running application.");
            ChangeStateTo(VostokApplicationState.Running);

            try
            {
                if (settings.SendAnnotations)
                {
                    AnnotationsHelper.ReportInitialized(environment.ApplicationIdentity, environment.Metrics.Instance);
                }

                return(await RunPhaseAsync(false).ConfigureAwait(false));
            }
            catch (Exception error)
            {
                log.Error(error, "Unhandled exception has occurred while running the application.");
                return(ReturnResult(VostokApplicationState.CrashedDuringRunning, error));
            }
        }