@@ -15,9 +15,11 @@ export class AndroidDeviceSocketsLiveSyncService extends DeviceLiveSyncServiceBa
1515 protected $staticConfig : Config . IStaticConfig ,
1616 private $logger : ILogger ,
1717 protected device : Mobile . IAndroidDevice ,
18- private $options : ICommonOptions ) {
18+ private $options : ICommonOptions ,
19+ private $processService : IProcessService ) {
1920 super ( $platformsData , device ) ;
2021 this . livesyncTool = this . $injector . resolve ( AndroidLivesyncTool ) ;
22+ this . $processService . attachToProcessExitSignals ( this . livesyncTool , this . livesyncTool . end ) ;
2123 }
2224
2325 public async beforeLiveSyncAction ( deviceAppData : Mobile . IDeviceAppData ) : Promise < void > {
@@ -35,7 +37,6 @@ export class AndroidDeviceSocketsLiveSyncService extends DeviceLiveSyncServiceBa
3537 const operationIdentifier = this . livesyncTool . generateOperationIdentifier ( ) ;
3638 const doSyncPromise = this . livesyncTool . sendDoSyncOperation ( operationIdentifier ) ;
3739
38- //TODO clear interval on exit sygnals/stopLivesync
3940 const syncInterval : NodeJS . Timer = setInterval ( ( ) => {
4041 if ( this . livesyncTool . isOperationInProgress ( operationIdentifier ) ) {
4142 this . $logger . info ( "Sync operation in progress..." ) ;
@@ -45,7 +46,10 @@ export class AndroidDeviceSocketsLiveSyncService extends DeviceLiveSyncServiceBa
4546 const clearSyncInterval = ( ) => {
4647 clearInterval ( syncInterval ) ;
4748 } ;
49+
50+ this . $processService . attachToProcessExitSignals ( this , clearSyncInterval ) ;
4851 doSyncPromise . then ( clearSyncInterval , clearSyncInterval ) ;
52+
4953 await doSyncPromise ;
5054
5155 if ( ! canExecuteFastSync ) {
0 commit comments