public void RefreshSitemap(object sender, EventArgs args) { var sites = SitemapManagerConfiguration.GetSiteNames(); foreach (var site in sites) { var config = new SitemapManagerConfiguration(site); var sitemapManager = new SitemapManager(config); sitemapManager.SubmitSitemapToSearchenginesByHttp(); if (!config.GenerateRobotsFile) { continue; } sitemapManager.RegisterSitemapToRobotsFile(); } }
public void RefreshSitemap(object sender, EventArgs args) { try { var sites = SitemapManagerConfiguration.GetSiteNames(); foreach (var site in sites) { var config = new SitemapManagerConfiguration(site); var sitemapManager = new SitemapManager(config); sitemapManager.SubmitSitemapToSearchenginesByHttp(); //removed because now the robots is generated when it is invoked the url with robots.txt at the end if (!config.GenerateRobotsFile) { continue; } sitemapManager.RegisterSitemapToRobotsFile(); } } catch (Exception e) { Log.Error("Error Sitemap", e, this); } }