Skip to content

Commit

Permalink
Docker will exit client due to no interactive terminal. Putting in sl…
Browse files Browse the repository at this point in the history
…eeps for now
  • Loading branch information
TWhidden committed Sep 23, 2018
1 parent e7e2fd2 commit 07be2d9
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions HolidayShowClient.Core/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using CommandLine;
using HolidayShowEndpointUniversalApp.Containers;
Expand Down Expand Up @@ -111,8 +112,25 @@ static void Main(string[] args)
var t = Load();
t.Wait();

Console.WriteLine("Press enter to end program");
Console.ReadLine();
#if NETCOREAPP
Thread.Sleep(Timeout.Infinite);
#endif

if (Environment.UserInteractive)
{
Console.WriteLine("Press [ENTER] to stop the server");
Console.ReadLine();
}
else
{
// Docker has no interactive mode. If there is no console, we need to sleep forever until the task is force quit.
Console.WriteLine("End Task to stop the server");
Thread.Sleep(Timeout.Infinite);
}

#if NETCOREAPP
Console.WriteLine($"SHUTTING DOWN! {DateTime.Now}");
#endif
}

private async static Task Load()
Expand Down

0 comments on commit 07be2d9

Please sign in to comment.