public void Run(ArticleScheduleTask articleTask) { var task = PublishingTask.Create(articleTask); var currentTime = _publishingService.GetCurrentDBDateTime(); if (ShouldProcessTask(task, currentTime)) { var article = _publishingService.PublishAndCloseSchedule(task.Id); Logger.Log.Info($"Article [{article.Id}: {article.Name}] has been published on customer code: {_customer.CustomerName}"); } }
public void Run(ArticleScheduleTask articleTask) { var task = PublishingTask.Create(articleTask); var currentTime = _publishingService.GetCurrentDBDateTime(); if (ShouldProcessTask(task, currentTime)) { var article = _publishingService.PublishAndCloseSchedule(task.Id); Logger.Info() .Message( "Article [{id}: {name}] has been published on customer code: {customerCode}", article.Id, article.Name, _customer.CustomerName) .Write(); } }
public bool ShouldProcessTask(ArticleScheduleTask task, DateTime dateTimeToCheck) => ShouldProcessTask(PublishingTask.Create(task), dateTimeToCheck);
public bool ShouldProcessTask(ArticleScheduleTask task, DateTime dateTimeToCheck, bool forMonitoring) { return(ShouldProcessTask(PublishingTask.Create(task), dateTimeToCheck, forMonitoring)); }