mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-12-12 21:29:56 +00:00
use the new async methods for the pipe
This commit is contained in:
parent
fce31b2782
commit
60a7536141
@ -54,10 +54,10 @@ namespace CompatBot.EventHandlers.LogParsing.ArchiveHandlers
|
||||
catch (Exception e)
|
||||
{
|
||||
Config.Log.Error(e, "Error filling the log pipe");
|
||||
writer.Complete(e);
|
||||
await writer.CompleteAsync(e);
|
||||
return;
|
||||
}
|
||||
writer.Complete();
|
||||
await writer.CompleteAsync();
|
||||
}
|
||||
}
|
||||
}
|
@ -41,10 +41,10 @@ namespace CompatBot.EventHandlers.LogParsing.ArchiveHandlers
|
||||
catch (Exception e)
|
||||
{
|
||||
Config.Log.Error(e, "Error filling the log pipe");
|
||||
writer.Complete(e);
|
||||
await writer.CompleteAsync(e);
|
||||
return;
|
||||
}
|
||||
writer.Complete();
|
||||
await writer.CompleteAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ namespace CompatBot.EventHandlers.LogParsing.ArchiveHandlers
|
||||
flushed = await writer.FlushAsync(cancellationToken).ConfigureAwait(false);
|
||||
SourcePosition = statsStream.Position;
|
||||
} while (read > 0 && !(flushed.IsCompleted || flushed.IsCanceled || cancellationToken.IsCancellationRequested));
|
||||
writer.Complete();
|
||||
await writer.CompleteAsync();
|
||||
return;
|
||||
}
|
||||
SourcePosition = statsStream.Position;
|
||||
@ -68,7 +68,7 @@ namespace CompatBot.EventHandlers.LogParsing.ArchiveHandlers
|
||||
{
|
||||
Config.Log.Error(e, "Error filling the log pipe");
|
||||
}
|
||||
writer.Complete();
|
||||
await writer.CompleteAsync();
|
||||
}
|
||||
}
|
||||
}
|
@ -54,7 +54,7 @@ namespace CompatBot.EventHandlers.LogParsing.ArchiveHandlers
|
||||
writer.Advance(read);
|
||||
flushed = await writer.FlushAsync(cancellationToken).ConfigureAwait(false);
|
||||
} while (read > 0 && !(flushed.IsCompleted || flushed.IsCanceled || cancellationToken.IsCancellationRequested));
|
||||
writer.Complete();
|
||||
await writer.CompleteAsync();
|
||||
return;
|
||||
}
|
||||
Config.Log.Warn("No 7z entries that match the log criteria");
|
||||
@ -63,7 +63,7 @@ namespace CompatBot.EventHandlers.LogParsing.ArchiveHandlers
|
||||
{
|
||||
Config.Log.Error(e, "Error filling the log pipe");
|
||||
}
|
||||
writer.Complete();
|
||||
await writer.CompleteAsync();
|
||||
}
|
||||
}
|
||||
}
|
@ -57,7 +57,7 @@ namespace CompatBot.EventHandlers.LogParsing.ArchiveHandlers
|
||||
flushed = await writer.FlushAsync(cancellationToken).ConfigureAwait(false);
|
||||
SourcePosition = statsStream.Position;
|
||||
} while (read > 0 && !(flushed.IsCompleted || flushed.IsCanceled || cancellationToken.IsCancellationRequested));
|
||||
writer.Complete();
|
||||
await writer.CompleteAsync();
|
||||
return;
|
||||
}
|
||||
SourcePosition = statsStream.Position;
|
||||
@ -68,8 +68,7 @@ namespace CompatBot.EventHandlers.LogParsing.ArchiveHandlers
|
||||
{
|
||||
Config.Log.Error(e, "Error filling the log pipe");
|
||||
}
|
||||
writer.Complete();
|
||||
|
||||
await writer.CompleteAsync();
|
||||
}
|
||||
}
|
||||
}
|
@ -55,7 +55,7 @@ namespace CompatBot.EventHandlers.LogParsing
|
||||
await OnNewLineAsync(buffer.Slice(0, lineEnd.Value), result.Buffer, currentSectionLines, state).ConfigureAwait(false);
|
||||
if (state.Error != LogParseState.ErrorCode.None)
|
||||
{
|
||||
reader.Complete();
|
||||
await reader.CompleteAsync();
|
||||
return state;
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ namespace CompatBot.EventHandlers.LogParsing
|
||||
} while (!(result.IsCompleted || result.IsCanceled || cancellationToken.IsCancellationRequested));
|
||||
await TaskScheduler.WaitForClearTagAsync(state).ConfigureAwait(false);
|
||||
state.ReadBytes = totalReadBytes;
|
||||
reader.Complete();
|
||||
await reader.CompleteAsync();
|
||||
return state;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user