Removes unpublish context menu option since it's not currently implemented, cleans up some code.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace Umbraco.Web.Trees
|
||||
menu.Items.Add<ActionAssignDomain>(ui.Text("actions", ActionAssignDomain.Instance.Alias)).ConvertLegacyMenuItem(item, "content", "content");
|
||||
menu.Items.Add<ActionRights>(ui.Text("actions", ActionRights.Instance.Alias)).ConvertLegacyMenuItem(item, "content", "content");
|
||||
menu.Items.Add<ActionProtect>(ui.Text("actions", ActionProtect.Instance.Alias), true).ConvertLegacyMenuItem(item, "content", "content");
|
||||
menu.Items.Add<ActionUnPublish>(ui.Text("actions", ActionUnPublish.Instance.Alias), true).ConvertLegacyMenuItem(item, "content", "content");
|
||||
|
||||
menu.Items.Add<ActionNotify>(ui.Text("actions", ActionNotify.Instance.Alias), true).ConvertLegacyMenuItem(item, "content", "content");
|
||||
menu.Items.Add<ActionSendToTranslate>(ui.Text("actions", ActionSendToTranslate.Instance.Alias)).ConvertLegacyMenuItem(item, "content", "content");
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace umbraco.presentation
|
||||
|
||||
if (runTask)
|
||||
{
|
||||
bool taskResult = getTaskByHttp(t.Url);
|
||||
bool taskResult = GetTaskByHttp(t.Url);
|
||||
if (t.Log)
|
||||
LogHelper.Info<publishingService>(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<publishingService>("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<publishingService>("Error sending url request for scheduled task", ex);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user