Skip to content

made slow detection more loose #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Uchu.World/Objects/Zone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -615,18 +615,18 @@ private Task ExecuteUpdateAsync()
updatedObject.Stuck = false;
});

var delay = Task.Delay(100);
var delay = Task.Delay(150);
await Task.WhenAny(tickTask, delay);
var elapsed = watch.ElapsedMilliseconds - start;

// Any task that takes more than 2 ticks to complete is considered stuck
// Any task that takes more than 3 ticks to complete is considered stuck
if (delay.IsCompleted && !tickTask.IsCompleted)
{
Logger.Warning($"{updatedObject.Associate} is now defined as stuck!");
updatedObject.Stuck = true;
}
// Any task that took more than one tick to execute but less than 2 is considered slow
else if (elapsed > 50)
// Any task that took more than two ticks to execute but less than 3 is considered slow
else if (elapsed > 100)
{
Logger.Warning($"Slow update: {updatedObject.Associate} in {elapsed}ms");
}
Expand Down