mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-07-13 17:13:00 +01:00
Fix port reselection
This commit is contained in:
@@ -169,20 +169,21 @@ namespace Tgstation.Server.Tests.Live.Instance
|
||||
|
||||
async Task UpdateDMSettings()
|
||||
{
|
||||
for (var i = 0; i < 10; ++i)
|
||||
const int Limit = 10;
|
||||
for (var i = 0; i < Limit; ++i)
|
||||
try
|
||||
{
|
||||
global::System.Console.WriteLine($"PORT REUSE BUG 6: Setting I-{instanceClient.Metadata.Id} DM to {dmPort}");
|
||||
if (i != 0)
|
||||
{
|
||||
global::System.Console.WriteLine($"PORT REUSE BUG 6: Setting I-{instanceClient.Metadata.Id} DM to {dmPort}");
|
||||
}
|
||||
await instanceClient.DreamMaker.Update(new DreamMakerRequest
|
||||
{
|
||||
ApiValidationPort = dmPort,
|
||||
}, cancellationToken);
|
||||
}
|
||||
catch (ConflictException ex) when (ex.ErrorCode == ErrorCode.PortNotAvailable)
|
||||
catch (ConflictException ex) when (ex.ErrorCode == ErrorCode.PortNotAvailable && i < (Limit - 1))
|
||||
{
|
||||
if (i == 4)
|
||||
throw;
|
||||
|
||||
// I have no idea why this happens sometimes
|
||||
await Task.Delay(TimeSpan.FromSeconds(3), cancellationToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user