mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
Increase interactive console responsiveness, misc
Previously we were sleeping always, also after execution of the command and after wrong keys being pressed, which resulted in excessive delay if user mashed his keyboard like a madman before hitting c to enter the console, entirely unnecessarily.
This commit is contained in:
@@ -311,6 +311,8 @@ internal static class Logging {
|
||||
while (!Program.ShutdownSequenceInitialized) {
|
||||
try {
|
||||
if (IsWaitingForUserInput || !Console.KeyAvailable) {
|
||||
await Task.Delay(ConsoleResponsivenessDelay).ConfigureAwait(false);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -379,8 +381,6 @@ internal static class Logging {
|
||||
ASF.ArchiLogger.LogGenericException(e);
|
||||
|
||||
return;
|
||||
} finally {
|
||||
await Task.Delay(ConsoleResponsivenessDelay).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ internal sealed class SteamTarget : AsyncTaskTarget {
|
||||
protected override async Task WriteAsyncTask(LogEventInfo logEvent, CancellationToken cancellationToken) {
|
||||
ArgumentNullException.ThrowIfNull(logEvent);
|
||||
|
||||
base.Write(logEvent);
|
||||
Write(logEvent);
|
||||
|
||||
if ((SteamID == 0) || (Bot.Bots == null) || Bot.Bots.IsEmpty) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user