From b80180dc8e632eb569300b0f31648df07d61a27a Mon Sep 17 00:00:00 2001 From: Hannes Hansen Date: Tue, 28 Nov 2023 09:39:37 +0100 Subject: [PATCH] dont send force delete/stop if no error occured --- .../pages/list/deployment-list.component.ts | 42 ++++++++++--------- src/app/jobs/list/list.component.ts | 2 +- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/app/deployments/pages/list/deployment-list.component.ts b/src/app/deployments/pages/list/deployment-list.component.ts index c8a6db0..8539bdc 100644 --- a/src/app/deployments/pages/list/deployment-list.component.ts +++ b/src/app/deployments/pages/list/deployment-list.component.ts @@ -47,7 +47,7 @@ export class DeploymentListComponent implements OnInit, OnDestroy { this.stopPeriodicRefresh() this.interval = setInterval(() => { this.loadDeployments(true); - }, 1000); + }, 5000); } stopPeriodicRefresh() { @@ -113,16 +113,17 @@ export class DeploymentListComponent implements OnInit, OnDestroy { this.sendStop(ids, false).pipe( catchError((err, _1) => { // stopping did not succeed because deployment is required - return this.utilsService.askForConfirmation(err + "\n" + "Do you want to force stop?") - }), - concatMap((forceConfirmed: any) => { - if(!forceConfirmed) { - this.ready = true - this.startPeriodicRefresh() - return of(true) - } - - return this.sendStop(ids, true) + return this.utilsService.askForConfirmation(err + "\n" + "Do you want to force stop?").pipe( + concatMap((forceConfirmed: any) => { + if(!forceConfirmed) { + this.ready = true + this.startPeriodicRefresh() + return of(true) + } + + return this.sendStop(ids, true) + }) + ) }) ).subscribe({ next: (_) => { @@ -270,15 +271,16 @@ export class DeploymentListComponent implements OnInit, OnDestroy { this.sendDelete(ids, false).pipe( catchError((err, _1) => { // stopping did not succeed because deployment is required - return this.utilsService.askForConfirmation(err + "\nDo you want to force delete?") - }), - concatMap((forceConfirmed: any) => { - if(!forceConfirmed) { - this.ready = true - this.startPeriodicRefresh() - return of(true) - } - return this.sendDelete(ids, true) + return this.utilsService.askForConfirmation(err + "\nDo you want to force delete?").pipe( + concatMap((forceConfirmed: any) => { + if(!forceConfirmed) { + this.ready = true + this.startPeriodicRefresh() + return of(true) + } + return this.sendDelete(ids, true) + }) + ) }) ).subscribe({ next: (_) => { diff --git a/src/app/jobs/list/list.component.ts b/src/app/jobs/list/list.component.ts index 169404c..bc87253 100644 --- a/src/app/jobs/list/list.component.ts +++ b/src/app/jobs/list/list.component.ts @@ -25,7 +25,7 @@ export class ListComponent implements OnInit, AfterViewInit { this.loadJobs() this.interval = setInterval(() => { this.loadJobs(); - }, 5000); + }, 1000); this.init = false }