mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Tweaking notification messages
--HG-- branch : dev
This commit is contained in:
@@ -59,8 +59,7 @@ namespace Orchard.Commands {
|
||||
}
|
||||
catch (OrchardCommandHostRetryException e) {
|
||||
// Special "Retry" return code for our host
|
||||
output.WriteLine("{0}", e.Message);
|
||||
output.WriteLine("(Retrying...)");
|
||||
output.WriteLine("{0} (Retrying...)", e.Message);
|
||||
return 240;
|
||||
}
|
||||
catch (Exception e) {
|
||||
@@ -82,8 +81,7 @@ namespace Orchard.Commands {
|
||||
}
|
||||
catch (OrchardCommandHostRetryException e) {
|
||||
// Special "Retry" return code for our host
|
||||
output.WriteLine("{0}", e.Message);
|
||||
output.WriteLine("(Retrying...)");
|
||||
output.WriteLine("{0} (Retrying...)", e.Message);
|
||||
return 240;
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
@@ -44,7 +44,7 @@ namespace Orchard.Commands {
|
||||
}
|
||||
|
||||
public void ResetSiteCompilation() {
|
||||
throw new OrchardCommandHostRetryException(T("A change of configuration requires the host to be restarted."));
|
||||
throw new OrchardCommandHostRetryException(T("A change of configuration requires the session to be restarted."));
|
||||
}
|
||||
}
|
||||
}
|
@@ -42,9 +42,9 @@ namespace OrchardCLI {
|
||||
}
|
||||
|
||||
private CommandHostContext CommandHostContext() {
|
||||
_output.WriteLine("Initializing Orchard session... (This might take a few seconds)");
|
||||
_output.WriteLine("Initializing Orchard session. (This might take a few seconds...)");
|
||||
var result = _commandHostContextProvider.CreateContext();
|
||||
if (result.StartSessionResult == 240/*special return code for "Retry"*/) {
|
||||
if (result.StartSessionResult == result.RetryResult) {
|
||||
result = _commandHostContextProvider.CreateContext();
|
||||
}
|
||||
return result;
|
||||
@@ -55,7 +55,7 @@ namespace OrchardCLI {
|
||||
return context;
|
||||
|
||||
int result = RunCommandInSession(context, command);
|
||||
if (result == 240/*special return code for "Retry"*/) {
|
||||
if (result == context.RetryResult) {
|
||||
_commandHostContextProvider.Shutdown(context);
|
||||
context = CommandHostContext();
|
||||
result = RunCommandInSession(context, command);
|
||||
@@ -71,8 +71,8 @@ namespace OrchardCLI {
|
||||
return context.CommandHost.RunCommandInSession(_input, _output, context.Logger, args);
|
||||
}
|
||||
catch (AppDomainUnloadedException) {
|
||||
_output.WriteLine("AppDomain of Orchard session has been unloaded. Retrying...");
|
||||
return 240;/*special return code for "Retry"*/
|
||||
_output.WriteLine("AppDomain of Orchard session has been unloaded. (Retrying...)");
|
||||
return context.RetryResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -7,6 +7,7 @@ using Orchard.Host;
|
||||
namespace OrchardCLI {
|
||||
public class CommandHostContext {
|
||||
public int StartSessionResult { get; set; }
|
||||
public int RetryResult { get; set; }
|
||||
public OrchardParameters Arguments { get; set; }
|
||||
public DirectoryInfo OrchardDirectory { get; set; }
|
||||
public ApplicationManager AppManager { get; set; }
|
||||
|
@@ -22,6 +22,7 @@ namespace OrchardCLI {
|
||||
|
||||
public CommandHostContext CreateContext() {
|
||||
var context = new CommandHostContext();
|
||||
context.RetryResult = 240;/*special return code for "Retry"*/
|
||||
Initialize(context);
|
||||
return context;
|
||||
}
|
||||
|
Reference in New Issue
Block a user