code update

This commit is contained in:
Stef Heyenrath
2018-01-23 08:06:55 +01:00
parent e6af765777
commit 141ed5d96c
3 changed files with 11 additions and 13 deletions

View File

@@ -7,15 +7,15 @@ namespace WireMock.Net.StandAlone.NETCoreApp
class Program
{
private static int sleepTime = 30000;
private static FluentMockServer server;
private static FluentMockServer _server;
static void Main(string[] args)
{
server = StandAloneApp.Start(args);
_server = StandAloneApp.Start(args);
Console.WriteLine($"{DateTime.UtcNow} Press Ctrl+C to shut down");
System.Console.CancelKeyPress += (s,e) =>
Console.CancelKeyPress += (s, e) =>
{
Stop("CancelKeyPress");
};
@@ -25,7 +25,7 @@ namespace WireMock.Net.StandAlone.NETCoreApp
Stop("AssemblyLoadContext.Default.Unloading");
};
while(true)
while (true)
{
Console.WriteLine($"{DateTime.UtcNow} WireMock.Net server running");
Thread.Sleep(sleepTime);
@@ -35,7 +35,7 @@ namespace WireMock.Net.StandAlone.NETCoreApp
private static void Stop(string why)
{
Console.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopping because '{why}'");
server.Stop();
_server.Stop();
Console.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopped");
}
}