Fix API coming online too early in race scenarios.

This commit is contained in:
Dean Herbert 2017-02-22 14:09:48 +09:00
parent 00ddcb11b4
commit d00ea4564f
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
1 changed files with 4 additions and 1 deletions

View File

@ -196,7 +196,10 @@ private bool handleRequest(APIRequest req)
Logger.Log($@"Performing request {req}", LoggingTarget.Network);
req.Perform(this);
State = APIState.Online;
//we could still be in initialisation, at which point we don't want to say we're Online yet.
if (LocalUser.Value != null)
State = APIState.Online;
failureCount = 0;
return true;
}