mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-02 23:05:15 +01:00
Respect timeout option in XHR-based requestService. Add timeout to remote preferences search
This commit is contained in:
@@ -62,6 +62,10 @@ export const xhrRequest: IRequestFunction = (options: IRequestOptions): TPromise
|
||||
});
|
||||
};
|
||||
|
||||
if (options.timeout) {
|
||||
xhr.timeout = options.timeout;
|
||||
}
|
||||
|
||||
xhr.send(options.data);
|
||||
return null;
|
||||
|
||||
|
||||
@@ -188,7 +188,8 @@ class RemoteSearchProvider {
|
||||
'User-Agent': 'request',
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
'api-key': endpoint.key
|
||||
}
|
||||
},
|
||||
timeout: 4000
|
||||
})
|
||||
.then(context => {
|
||||
if (context.res.statusCode >= 300) {
|
||||
|
||||
Reference in New Issue
Block a user