예제 #1
0
        public static void StartService()
        {
            DBResourceManager.PatchAssemblies();
            var url = HealthCheckCfgSectionHandler.Instance.Url;

            log.DebugFormat("StartSevice: RunHealthCheckService. url: {0}", url);
            webApiHost = WebApp.Start <Startup>(url);

            /* Hack for mono because first requests can failed.
             * https://bugzilla.xamarin.com/show_bug.cgi?format=multiple&id=17965
             */
            var warmingUpper = new WarmingUpper();

            warmingUpper.WarmingUp(url);

            HealthCheckRunner.Run();
        }
        public HttpResponseMessage RefreshLicense()
        {
            try
            {
                log.Debug("ChangeLicenseStatus");
                LicenseReader.RefreshLicense();
                if (!ServiceRepository.GetServicesSnapshot().Any())
                {
                    HealthCheckRunner.Run();
                }

                return(ResultHelper.Success());
            }
            catch (Exception ex)
            {
                log.ErrorFormat("Unexpected error on RefreshLicense: {0} {1}", ex.ToString(), ex.InnerException != null ? ex.InnerException.Message : string.Empty);
                return(ResultHelper.ServerError());
            }
        }