Skip to content

Commit

Permalink
fixed error handling after adding job error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
hahahannes committed Nov 27, 2023
1 parent a2609e7 commit eb81caf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class ModuleManagerService {
}
queryParams = queryParams.set("ids", deploymentIDs.join(","))
return <Observable<any>>this.http.patch(url, undefined, queryParams, 'text');
}
}

loadDeploymentUpdateTemplate(moduleId: string): Observable<DeploymentTemplate> {
var url = this.moduleManagerPath + "/deployments/" + this.doubleEncode(moduleId) + '/upt-template'
Expand Down
17 changes: 10 additions & 7 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);
}, 5000);
}, 1000);
}

stopPeriodicRefresh() {
Expand Down Expand Up @@ -119,7 +119,7 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
if(!forceConfirmed) {
this.ready = true
this.startPeriodicRefresh()
return of()
return of(true)
}

return this.sendStop(ids, true)
Expand Down Expand Up @@ -155,7 +155,7 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
return throwError(() => new Error(result.error))
}

return of()
return of(true)
})
)
}
Expand Down Expand Up @@ -236,7 +236,7 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
if(!result.success) {
return throwError(() => new Error(result.error))
}
return of()
return of(true)
})
).subscribe({
next: (_) => {
Expand Down Expand Up @@ -276,19 +276,20 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
if(!forceConfirmed) {
this.ready = true
this.startPeriodicRefresh()
return of()
return of(true)
}

return this.sendDelete(ids, true)
})
).subscribe({
next: (_) => {
this.loadDeployments(false)
this.startPeriodicRefresh()
this.ready = true
},
error: (err) => {
this.errorService.handleError(DeploymentListComponent.name, "_delete", err)
this.startPeriodicRefresh()
this.ready = true
}
})
}
Expand All @@ -309,7 +310,9 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
if(!result.success && !forceConfirmed) {
return throwError(() => new Error(result.error))
}
return of()

// have to send some value so that the subscribe afterwards works
return of(true)
})
)
}
Expand Down

0 comments on commit eb81caf

Please sign in to comment.