private async Task LoadGeoData()
        {
            try
            {
                GoWebsiteCache websiteCache = new GoWebsiteCache();
                Stopwatch      stopwatch    = Stopwatch.StartNew();

                HostingEnvironment.QueueBackgroundWorkItem(async(x) =>
                {
                    var settings = PortalDataAccess.GetApplicationSetting();
                    if (settings == null)
                    {
                        settings = new WebsiteSetting();
                        settings.SetDefaultClient();
                    }

                    WebsiteSettingsManager.Load(settings);
                });

                Log.Info($"Wating for all tasks to end {stopwatch.Elapsed}");

                Log.Info($"all tasks to end {stopwatch.Elapsed}");
            }
            catch (Exception ex)
            {
                Log.Error("Failed to load data");
                Log.Error(ex.ToString());
                throw;
            }
        }
Example #2
0
        protected void Application_Start()
        {
            ApplicationStartTime = DateTime.Now;

            TelemetryConfiguration.Active.DisableTelemetry = true;
            //WebsiteSettingsManager.SettingChanged += WebsiteSettingsManager_SettingChanged;
            var applicationSetting = PortalDataAccess.GetApplicationSetting();

            //WebsiteSetting applicationSetting = null;
            if (applicationSetting == null)
            {
                applicationSetting = new WebsiteSetting();
                applicationSetting.SetDefaultClient();
            }

            WebsiteSettingsManager.Load(applicationSetting);

            AreaRegistration.RegisterAllAreas();
            //GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //SqlDependency.Start(ApplicationSettingManager.SQLConnectionString);
        }