diff --git a/src/Umbraco.Web/LegacyScheduledTasks.cs b/src/Umbraco.Web/LegacyScheduledTasks.cs index cb5166ff7e..1fcc34d082 100644 --- a/src/Umbraco.Web/LegacyScheduledTasks.cs +++ b/src/Umbraco.Web/LegacyScheduledTasks.cs @@ -12,11 +12,7 @@ using global::umbraco.BusinessLogic; namespace Umbraco.Web { - // note: has to be public to be detected by the resolver - // if it's made internal, which would make more sense, then it's not detected - // and it needs to be manually registered - which we want to avoid, in order - // to be as unobtrusive as possible - + internal sealed class LegacyScheduledTasks : ApplicationEventHandler { Timer _pingTimer; diff --git a/src/Umbraco.Web/Trees/ContentTreeController.cs b/src/Umbraco.Web/Trees/ContentTreeController.cs index a96fc8cdbd..5bfa20e030 100644 --- a/src/Umbraco.Web/Trees/ContentTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentTreeController.cs @@ -198,7 +198,7 @@ namespace Umbraco.Web.Trees menu.Items.Add(ui.Text("actions", ActionAssignDomain.Instance.Alias)).ConvertLegacyMenuItem(item, "content", "content"); menu.Items.Add(ui.Text("actions", ActionRights.Instance.Alias)).ConvertLegacyMenuItem(item, "content", "content"); menu.Items.Add(ui.Text("actions", ActionProtect.Instance.Alias), true).ConvertLegacyMenuItem(item, "content", "content"); - menu.Items.Add(ui.Text("actions", ActionUnPublish.Instance.Alias), true).ConvertLegacyMenuItem(item, "content", "content"); + menu.Items.Add(ui.Text("actions", ActionNotify.Instance.Alias), true).ConvertLegacyMenuItem(item, "content", "content"); menu.Items.Add(ui.Text("actions", ActionSendToTranslate.Instance.Alias)).ConvertLegacyMenuItem(item, "content", "content"); diff --git a/src/Umbraco.Web/umbraco.presentation/publishingService.cs b/src/Umbraco.Web/umbraco.presentation/publishingService.cs index af88c472cb..45af834543 100644 --- a/src/Umbraco.Web/umbraco.presentation/publishingService.cs +++ b/src/Umbraco.Web/umbraco.presentation/publishingService.cs @@ -81,7 +81,7 @@ namespace umbraco.presentation if (runTask) { - bool taskResult = getTaskByHttp(t.Url); + bool taskResult = GetTaskByHttp(t.Url); if (t.Log) LogHelper.Info(string.Format("{0} has been called with response: {1}", t.Alias, taskResult)); } @@ -94,7 +94,7 @@ namespace umbraco.presentation } catch(Exception x) { - Debug.WriteLine(x); + LogHelper.Error("Error executing scheduled publishing", x); } finally { @@ -102,35 +102,23 @@ namespace umbraco.presentation } } - private static bool getTaskByHttp(string url) + private static bool GetTaskByHttp(string url) { var myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url); - HttpWebResponse myHttpWebResponse = null; - try - { - myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse(); - if(myHttpWebResponse.StatusCode == HttpStatusCode.OK) - { - myHttpWebResponse.Close(); - return true; - } - else - { - myHttpWebResponse.Close(); - return false; - } - } - catch - { - } - finally - { - // Release the HttpWebResponse Resource. - if(myHttpWebResponse != null) - myHttpWebResponse.Close(); - } - return false; + try + { + using (var myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse()) + { + return myHttpWebResponse.StatusCode == HttpStatusCode.OK; + } + } + catch (Exception ex) + { + LogHelper.Error("Error sending url request for scheduled task", ex); + } + + return false; } } } \ No newline at end of file