Skip to content

Commit 227ed63

Browse files
committed
Close #5
1 parent f579d35 commit 227ed63

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/RemotePythonExecution.Services/RemotePythonExecutionService.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Microsoft.Extensions.Hosting;
33
using Microsoft.Extensions.Logging;
44
using Microsoft.Extensions.Options;
5-
using RemotePythonExecution.Interface;
65
using System;
76
using System.Collections.Generic;
87
using System.Diagnostics;
@@ -173,6 +172,7 @@ private void ProcessErrorDataReceived(object sender, DataReceivedEventArgs e)
173172
try
174173
{
175174
mTcpServer.SendAsync(CurrentConnectionGuid, e.Data);
175+
mLogger.LogDebug("{data}", e.Data);
176176
mIsOutputEnded = false;
177177
}
178178
catch (Exception exp)
@@ -191,11 +191,11 @@ private async void ProcessOutputDataReceived(object sender, DataReceivedEventArg
191191
{
192192
await mTcpServer.SendAsync(CurrentConnectionGuid, e.Data, start: 0);
193193
mLogger.LogDebug("{data}", e.Data);
194-
mIsOutputEnded = false;
195194
}
196195
catch (TaskCanceledException)
197196
{
198197
mLogger.LogError("Task was canceled");
198+
mIsOutputEnded = true;
199199
}
200200
catch (Exception exp)
201201
{
@@ -206,6 +206,7 @@ private async void ProcessOutputDataReceived(object sender, DataReceivedEventArg
206206
else
207207
{
208208
mLogger.LogDebug("Output ended happened");
209+
await Task.Delay(100);
209210
mIsOutputEnded = true;
210211
}
211212
}
@@ -369,8 +370,7 @@ private void OnServerAddressChange()
369370
mIsOutputEnded = true;
370371
mIsProcessEnded = true;
371372
}
372-
373-
373+
374374
mTcpServer.Stop();
375375
UnSubscribe();
376376
}
@@ -410,8 +410,8 @@ private void SaveCodeAndStartProcess(string code, bool withDebug)
410410

411411
private void StartProcess(bool withDebug = false)
412412
{
413-
string arg = string.Format($"-u -m {Path.GetFileNameWithoutExtension(SourceCodeSavePath)}");
414-
413+
string arg = string.Format($"-u {SourceCodeSavePath}");
414+
415415
if (withDebug)
416416
arg = string.Format($"-u -m pdb {SourceCodeSavePath}");
417417

0 commit comments

Comments
 (0)