Skip to content

Commit

Permalink
dont send force delete/stop if no error occured
Browse files Browse the repository at this point in the history
  • Loading branch information
hahahannes committed Nov 28, 2023
1 parent eb81caf commit b80180d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
42 changes: 22 additions & 20 deletions src/app/deployments/pages/list/deployment-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
this.stopPeriodicRefresh()
this.interval = setInterval(() => {
this.loadDeployments(true);
}, 1000);
}, 5000);
}

stopPeriodicRefresh() {
Expand Down Expand Up @@ -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: (_) => {
Expand Down Expand Up @@ -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: (_) => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/jobs/list/list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class ListComponent implements OnInit, AfterViewInit {
this.loadJobs()
this.interval = setInterval(() => {
this.loadJobs();
}, 5000);
}, 1000);
this.init = false
}

Expand Down

0 comments on commit b80180d

Please sign in to comment.