2
2
using Microsoft . Extensions . Hosting ;
3
3
using Microsoft . Extensions . Logging ;
4
4
using Microsoft . Extensions . Options ;
5
- using RemotePythonExecution . Interface ;
6
5
using System ;
7
6
using System . Collections . Generic ;
8
7
using System . Diagnostics ;
@@ -173,6 +172,7 @@ private void ProcessErrorDataReceived(object sender, DataReceivedEventArgs e)
173
172
try
174
173
{
175
174
mTcpServer . SendAsync ( CurrentConnectionGuid , e . Data ) ;
175
+ mLogger . LogDebug ( "{data}" , e . Data ) ;
176
176
mIsOutputEnded = false ;
177
177
}
178
178
catch ( Exception exp )
@@ -191,11 +191,11 @@ private async void ProcessOutputDataReceived(object sender, DataReceivedEventArg
191
191
{
192
192
await mTcpServer . SendAsync ( CurrentConnectionGuid , e . Data , start : 0 ) ;
193
193
mLogger . LogDebug ( "{data}" , e . Data ) ;
194
- mIsOutputEnded = false ;
195
194
}
196
195
catch ( TaskCanceledException )
197
196
{
198
197
mLogger . LogError ( "Task was canceled" ) ;
198
+ mIsOutputEnded = true ;
199
199
}
200
200
catch ( Exception exp )
201
201
{
@@ -206,6 +206,7 @@ private async void ProcessOutputDataReceived(object sender, DataReceivedEventArg
206
206
else
207
207
{
208
208
mLogger . LogDebug ( "Output ended happened" ) ;
209
+ await Task . Delay ( 100 ) ;
209
210
mIsOutputEnded = true ;
210
211
}
211
212
}
@@ -369,8 +370,7 @@ private void OnServerAddressChange()
369
370
mIsOutputEnded = true ;
370
371
mIsProcessEnded = true ;
371
372
}
372
-
373
-
373
+
374
374
mTcpServer . Stop ( ) ;
375
375
UnSubscribe ( ) ;
376
376
}
@@ -410,8 +410,8 @@ private void SaveCodeAndStartProcess(string code, bool withDebug)
410
410
411
411
private void StartProcess ( bool withDebug = false )
412
412
{
413
- string arg = string . Format ( $ "-u -m { Path . GetFileNameWithoutExtension ( SourceCodeSavePath ) } ") ;
414
-
413
+ string arg = string . Format ( $ "-u { SourceCodeSavePath } ") ;
414
+
415
415
if ( withDebug )
416
416
arg = string . Format ( $ "-u -m pdb { SourceCodeSavePath } ") ;
417
417
0 commit comments