public void Run(OxiteModuleConfigurationElement moduleConfiguration) { AppSettingsHelper settings = new AppSettingsHelper(moduleConfiguration.Settings.ToNameValueCollection()); //TODO: (erikpo) Refactor GetNext call to not need an interval if possible TimeSpan interval = settings.GetTimeSpan("SendTrackbacks.Interval", TimeSpan.FromMinutes(1)); int blockSize = settings.GetInt32("SendTrackbacks.BlockSize", 1); foreach (TrackbackOutbound trackback in trackbackOutboundService.GetNext(interval, blockSize)) { try { sendTrackback(trackback); trackback.MarkAsCompleted(); } catch { trackback.MarkAsFailed(); } finally { trackbackOutboundService.Save(trackback); } } }
public override void Run() { foreach (TrackbackOutbound trackback in trackbackOutboundService.GetNext(ExecuteOnAll, Interval)) { try { sendTrackback(trackback); trackback.MarkAsCompleted(); } catch { trackback.MarkAsFailed(); } finally { trackbackOutboundService.Save(trackback); } } }
public void Run(NameValueCollection settings) { bool executeOnAll = bool.Parse(settings["ExecuteOnAll"]); TimeSpan interval = TimeSpan.FromTicks(long.Parse(settings["Interval"])); foreach (TrackbackOutbound trackback in trackbackOutboundService.GetNext(executeOnAll, interval)) { try { sendTrackback(trackback); trackback.MarkAsCompleted(); } catch { trackback.MarkAsFailed(); } finally { trackbackOutboundService.Save(trackback); } } }