Refactor Started Ping

This commit is contained in:
ChsBuffer
2021-05-24 19:07:17 +08:00
parent 43c19c6698
commit e3a3396d18

View File

@@ -500,18 +500,17 @@ namespace Netch.Forms
{
while (State == State.Started)
{
bool StartedPingEnabled() => Global.Settings.StartedPingInterval >= 0;
if (StartedPingEnabled())
if (Global.Settings.StartedPingInterval >= 0)
{
server.Test();
ServerComboBox.Refresh();
}
if (StartedPingEnabled())
Thread.Sleep(Global.Settings.StartedPingInterval * 1000);
}
else
{
Thread.Sleep(5000);
}
}
});
}