Skip to content

Commit

Permalink
Merge pull request #142 from kaleido-io/restore-certs
Browse files Browse the repository at this point in the history
Restore certs on healthcheck
  • Loading branch information
nguyer authored Apr 12, 2024
2 parents 1657bb8 + 2237c86 commit 1947041
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions src/health/health.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ export class HealthController {
@HealthCheck()
readiness() {
return this.health.check([
() =>
this.http.pingCheck('ethconnect', `${this.blockchain.baseUrl}/status`, {
auth: {
username: this.blockchain.username,
password: this.blockchain.password,
},
}),
() => {
const httpOptions = getHttpRequestOptions(
this.blockchain.username,
this.blockchain.password,
);
return this.http.pingCheck('ethconnect', `${this.blockchain.baseUrl}/status`, {
auth: httpOptions.auth,
httpAgent: httpOptions.httpAgent,
});
},
]);
}
}
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const getWebsocketOptions = (username: string, password: string): ClientO
return requestOptions;
};

export const getHttpRequestOptions = (username: string, password: string) => {
export const getHttpRequestOptions = (username: string, password: string): AxiosRequestConfig => {
const requestOptions: AxiosRequestConfig = {};
if (username !== '' && password !== '') {
requestOptions.auth = {
Expand Down

0 comments on commit 1947041

Please sign in to comment.