Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
update default timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyione committed Jul 22, 2020
1 parent 2069ac5 commit a15cdb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/api/v2/models/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface IPAICluster {
k8s_dashboard_uri?: string;
web_portal_uri?: string;
protocol_version?: string;
request_timeout?: number;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/commom/paiHttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { processResponse, IPAIResponseProcessor } from './paiResponseProcessor';
* Http client for PAI rest-server.
*/
export class PAIHttpClient {
protected static readonly TIMEOUT: number = 10 * 1000;
protected static readonly TIMEOUT: number = 60 * 1000;
protected static readonly EXPIRATION: number = 4000;
private readonly cluster: IPAICluster;

Expand Down Expand Up @@ -203,7 +203,7 @@ export class PAIHttpClient {
Authorization: `Bearer ${this.cluster.token}`,
'content-type': 'application/json'
},
timeout: PAIHttpClient.TIMEOUT
timeout: this.cluster.request_timeout || PAIHttpClient.TIMEOUT
};
}
}

0 comments on commit a15cdb7

Please sign in to comment.