Merge branch 'main' of https://github.com/Derek-R-S/Light-Reflective-Mirror into main
This commit is contained in:
commit
c9ea1a03cc
1 changed files with 7 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using Grapevine;
|
||||
using Grapevine;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
|
@ -83,8 +83,12 @@ namespace LightReflectiveMirror.LoadBalancing
|
|||
if (lowest.Key.Address != "Dummy")
|
||||
{
|
||||
// ping server to ensure its online.
|
||||
await Program.instance.ManualPingServer(lowest.Key.Address, lowest.Key.Port);
|
||||
await context.Response.SendResponseAsync(JsonConvert.SerializeObject(lowest.Key));
|
||||
var chosenServer = await Program.instance.ManualPingServer(lowest.Key.Address, lowest.Key.EndpointPort);
|
||||
|
||||
if(chosenServer.HasValue)
|
||||
await context.Response.SendResponseAsync(JsonConvert.SerializeObject(lowest.Key));
|
||||
else
|
||||
await context.Response.SendResponseAsync(HttpStatusCode.BadGateway);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue