Tweaking notification messages

--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-07-24 15:03:13 -07:00
parent 677cfd3c6f
commit 768037b659
5 changed files with 10 additions and 10 deletions

View File

@@ -59,8 +59,7 @@ namespace Orchard.Commands {
} }
catch (OrchardCommandHostRetryException e) { catch (OrchardCommandHostRetryException e) {
// Special "Retry" return code for our host // Special "Retry" return code for our host
output.WriteLine("{0}", e.Message); output.WriteLine("{0} (Retrying...)", e.Message);
output.WriteLine("(Retrying...)");
return 240; return 240;
} }
catch (Exception e) { catch (Exception e) {
@@ -82,8 +81,7 @@ namespace Orchard.Commands {
} }
catch (OrchardCommandHostRetryException e) { catch (OrchardCommandHostRetryException e) {
// Special "Retry" return code for our host // Special "Retry" return code for our host
output.WriteLine("{0}", e.Message); output.WriteLine("{0} (Retrying...)", e.Message);
output.WriteLine("(Retrying...)");
return 240; return 240;
} }
catch (Exception e) { catch (Exception e) {

View File

@@ -44,7 +44,7 @@ namespace Orchard.Commands {
} }
public void ResetSiteCompilation() { 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."));
} }
} }
} }

View File

@@ -42,9 +42,9 @@ namespace OrchardCLI {
} }
private CommandHostContext CommandHostContext() { 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(); var result = _commandHostContextProvider.CreateContext();
if (result.StartSessionResult == 240/*special return code for "Retry"*/) { if (result.StartSessionResult == result.RetryResult) {
result = _commandHostContextProvider.CreateContext(); result = _commandHostContextProvider.CreateContext();
} }
return result; return result;
@@ -55,7 +55,7 @@ namespace OrchardCLI {
return context; return context;
int result = RunCommandInSession(context, command); int result = RunCommandInSession(context, command);
if (result == 240/*special return code for "Retry"*/) { if (result == context.RetryResult) {
_commandHostContextProvider.Shutdown(context); _commandHostContextProvider.Shutdown(context);
context = CommandHostContext(); context = CommandHostContext();
result = RunCommandInSession(context, command); result = RunCommandInSession(context, command);
@@ -71,8 +71,8 @@ namespace OrchardCLI {
return context.CommandHost.RunCommandInSession(_input, _output, context.Logger, args); return context.CommandHost.RunCommandInSession(_input, _output, context.Logger, args);
} }
catch (AppDomainUnloadedException) { catch (AppDomainUnloadedException) {
_output.WriteLine("AppDomain of Orchard session has been unloaded. Retrying..."); _output.WriteLine("AppDomain of Orchard session has been unloaded. (Retrying...)");
return 240;/*special return code for "Retry"*/ return context.RetryResult;
} }
} }
} }

View File

@@ -7,6 +7,7 @@ using Orchard.Host;
namespace OrchardCLI { namespace OrchardCLI {
public class CommandHostContext { public class CommandHostContext {
public int StartSessionResult { get; set; } public int StartSessionResult { get; set; }
public int RetryResult { get; set; }
public OrchardParameters Arguments { get; set; } public OrchardParameters Arguments { get; set; }
public DirectoryInfo OrchardDirectory { get; set; } public DirectoryInfo OrchardDirectory { get; set; }
public ApplicationManager AppManager { get; set; } public ApplicationManager AppManager { get; set; }

View File

@@ -22,6 +22,7 @@ namespace OrchardCLI {
public CommandHostContext CreateContext() { public CommandHostContext CreateContext() {
var context = new CommandHostContext(); var context = new CommandHostContext();
context.RetryResult = 240;/*special return code for "Retry"*/
Initialize(context); Initialize(context);
return context; return context;
} }