mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-15 04:14:15 +01:00
fix some performance issues
This commit is contained in:
parent
7e87dc61e7
commit
90a25c23dc
5 changed files with 25 additions and 9 deletions
|
|
@ -179,13 +179,15 @@ public class PlayerManager : IDisposable
|
|||
token.ThrowIfCancellationRequested();
|
||||
}
|
||||
|
||||
while (!PermanentDataCache.IsReady && !token.IsCancellationRequested)
|
||||
int timeOut = 10000;
|
||||
while (!PermanentDataCache.IsReady && !token.IsCancellationRequested && timeOut >= 0)
|
||||
{
|
||||
Logger.Verbose("Waiting until cache is ready");
|
||||
Logger.Verbose("Waiting until cache is ready (Timeout: " + TimeSpan.FromMilliseconds(timeOut) + ")");
|
||||
await Task.Delay(50, token).ConfigureAwait(false);
|
||||
timeOut -= 50;
|
||||
}
|
||||
|
||||
if (token.IsCancellationRequested) return null;
|
||||
if (token.IsCancellationRequested || timeOut <= 0) return null;
|
||||
|
||||
Logger.Verbose("Cache creation complete");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue