|
@@ -213,15 +213,13 @@ export default class ContextWatchdog extends Watchdog {
|
|
|
*/
|
|
*/
|
|
|
remove( itemNames ) {
|
|
remove( itemNames ) {
|
|
|
return this._actionQueue.enqueue( () => {
|
|
return this._actionQueue.enqueue( () => {
|
|
|
|
|
+ console.log( 'remove' );
|
|
|
|
|
+
|
|
|
return Promise.all( itemNames.map( itemName => {
|
|
return Promise.all( itemNames.map( itemName => {
|
|
|
- const watchdog = this._watchdogs.get( itemName );
|
|
|
|
|
|
|
+ const watchdog = this._getWatchdog( itemName );
|
|
|
|
|
|
|
|
this._watchdogs.delete( itemName );
|
|
this._watchdogs.delete( itemName );
|
|
|
|
|
|
|
|
- if ( !watchdog ) {
|
|
|
|
|
- throw new Error( `There is no watchdog named: '${ itemName }'.` );
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
return watchdog.destroy();
|
|
return watchdog.destroy();
|
|
|
} ) );
|
|
} ) );
|
|
|
} );
|
|
} );
|
|
@@ -271,6 +269,7 @@ export default class ContextWatchdog extends Watchdog {
|
|
|
*/
|
|
*/
|
|
|
_restart() {
|
|
_restart() {
|
|
|
return this._actionQueue.enqueue( () => {
|
|
return this._actionQueue.enqueue( () => {
|
|
|
|
|
+ console.log( 'restarting' );
|
|
|
this.state = 'initializing';
|
|
this.state = 'initializing';
|
|
|
|
|
|
|
|
return this._destroy()
|
|
return this._destroy()
|
|
@@ -278,7 +277,8 @@ export default class ContextWatchdog extends Watchdog {
|
|
|
console.error( 'An error happened during destructing.', err );
|
|
console.error( 'An error happened during destructing.', err );
|
|
|
} )
|
|
} )
|
|
|
.then( () => this._create() )
|
|
.then( () => this._create() )
|
|
|
- .then( () => this.fire( 'restart' ) );
|
|
|
|
|
|
|
+ .then( () => this.fire( 'restart' ) )
|
|
|
|
|
+ .then( () => console.log( 'restarted' ) );
|
|
|
} );
|
|
} );
|
|
|
}
|
|
}
|
|
|
|
|
|