Implement handling of deployment failures

This commit is contained in:
Kristóf Tóth
2018-03-07 15:15:28 +01:00
parent 18aaebd758
commit f318f94f4d
4 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,5 @@
export class ProcessCommand {
command: string;
process_name: string;
error: boolean
}

View File

@ -16,9 +16,9 @@ export class ProcessManagerService {
this.webSocketService.connect();
}
subscribeCallback(process_name: string, callback: (event: any) => void) {
subscribeCallback(process_name: string, error: boolean, callback: (event: any) => void) {
this.webSocketService.observeKey<ProcessCommand>(this.key)
.pipe(filter(message => message.data.process_name === process_name)).subscribe(callback);
.pipe(filter(message => message.data.process_name === process_name && message.data.error === error)).subscribe(callback);
}
sendCommand(command: string, process_name: string) {