diff --git a/src/Umbraco.Core/Publishing/ScheduledPublisher.cs b/src/Umbraco.Core/Publishing/ScheduledPublisher.cs index 94df1b88f1..b57bb1451a 100644 --- a/src/Umbraco.Core/Publishing/ScheduledPublisher.cs +++ b/src/Umbraco.Core/Publishing/ScheduledPublisher.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.Services; @@ -26,12 +27,16 @@ namespace Umbraco.Core.Publishing public int CheckPendingAndProcess() { var counter = 0; - foreach (var d in _contentService.GetContentForRelease()) + var contentForRelease = _contentService.GetContentForRelease().ToArray(); + if (contentForRelease.Length > 0) + LogHelper.Debug(string.Format("There's {0} item(s) of content to be published", contentForRelease.Length)); + foreach (var d in contentForRelease) { try { d.ReleaseDate = null; var result = _contentService.SaveAndPublishWithStatus(d, (int)d.GetWriterProfile().Id); + LogHelper.Debug(string.Format("Result of publish attempt: {0}", result.Result.StatusType)); if (result.Success == false) { if (result.Exception != null) @@ -54,7 +59,11 @@ namespace Umbraco.Core.Publishing throw; } } - foreach (var d in _contentService.GetContentForExpiration()) + + var contentForExpiration = _contentService.GetContentForExpiration().ToArray(); + if (contentForExpiration.Length > 0) + LogHelper.Debug(string.Format("There's {0} item(s) of content to be unpublished", contentForExpiration.Length)); + foreach (var d in contentForExpiration) { try { diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index 1703768ed2..c00b226d3e 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1124,7 +1124,9 @@ namespace Umbraco.Core.Services /// True if unpublishing succeeded, otherwise False public bool UnPublish(IContent content, int userId = 0) { - return ((IContentServiceOperations)this).UnPublish(content, userId).Success; + var attempt = ((IContentServiceOperations)this).UnPublish(content, userId); + LogHelper.Debug(string.Format("Result of unpublish attempt: {0}", attempt.Result.StatusType)); + return attempt.Success; } ///