mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Suppress JsonRPC Empty Response Exception and refactor code
This commit is contained in:
parent
76d23aba9b
commit
c3dd3b1851
1 changed files with 8 additions and 8 deletions
|
|
@ -254,6 +254,14 @@ namespace Flow.Launcher.Core.Plugin
|
|||
return Stream.Null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var sourceBuffer = BufferManager.GetStream();
|
||||
var errorBuffer = BufferManager.GetStream();
|
||||
|
||||
var sourceCopyTask = process.StandardOutput.BaseStream.CopyToAsync(sourceBuffer, token);
|
||||
var errorCopyTask = process.StandardError.BaseStream.CopyToAsync(errorBuffer, token);
|
||||
|
||||
token.Register(() =>
|
||||
{
|
||||
try
|
||||
|
|
@ -266,14 +274,6 @@ namespace Flow.Launcher.Core.Plugin
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
var sourceBuffer = BufferManager.GetStream();
|
||||
var errorBuffer = BufferManager.GetStream();
|
||||
|
||||
var sourceCopyTask = process.StandardOutput.BaseStream.CopyToAsync(sourceBuffer, token);
|
||||
var errorCopyTask = process.StandardError.BaseStream.CopyToAsync(errorBuffer, token);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
// token expire won't instantly trigger the exception,
|
||||
|
|
|
|||
Loading…
Reference in a new issue