private static void OnTimedEvent(object sender, ElapsedEventArgs e) { //Log before DateTime timeBeginLoad = DateTime.Now; string stringTimeBeginLoad = timeBeginLoad.ToString(); //_logger.Log("New load engaged: " + stringTimeBeginLoad); VacancyService.LoadListFromDB(); //Log after DateTime timeEndLoad = DateTime.Now; string stringTimeEndLoad = timeEndLoad.ToString(); // _logger.Log("Load completed: " + stringTimeEndLoad); }
// private string DBLoadString = "https://api.catsone.com/api/get_joborders?save_user_values=1&subdomain=sentimus&transaction_code=fd20aba59b0968107547f1107ff78fd4&search=%22C%23%22&rows_per_page=50&page_number=0&sort=id%2C+title%2C+description%2C+is_hot%2C+company&sort_direction=&display_column=&list=&filter="; protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); _logger = new BackendLogger(); timer = new Timer(); //1 hour (60s * 60m) //timer.Interval = 60000 * 60; //Test // timer.Elapsed += new ElapsedEventHandler(OnTimedEvent); //// timer.Interval = 60000; // timer.Enabled = true; // timer.AutoReset = true; VacancyService.LoadListFromDB(); }