File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -25,14 +25,16 @@ class OrsBase {
25
25
if ( args [ Constants . propNames . service ] ) {
26
26
this . defaultArgs [ Constants . propNames . service ] = args [ Constants . propNames . service ]
27
27
}
28
+ if ( args [ Constants . propNames . timeout ] ) {
29
+ this . defaultArgs [ Constants . propNames . timeout ] = args [ Constants . propNames . timeout ]
30
+ }
28
31
if ( Constants . propNames . apiKey in args ) {
29
32
this . defaultArgs [ Constants . propNames . apiKey ] = args [ Constants . propNames . apiKey ]
30
33
} else if ( ! args [ Constants . propNames . host ] ) {
31
34
// Do not error if a host is specified; useful for locally-run instances of ORS
32
35
console . error ( Constants . missingAPIKeyMsg )
33
36
throw new Error ( Constants . missingAPIKeyMsg )
34
37
}
35
-
36
38
}
37
39
38
40
checkHeaders ( ) {
@@ -65,7 +67,7 @@ class OrsBase {
65
67
66
68
async createRequest ( body ) {
67
69
const controller = new AbortController ( )
68
- const timeout = setTimeout ( ( ) => controller . abort ( 'timed out' ) , this . defaultArgs [ Constants . propNames . timeout ] || 5000 )
70
+ const timeout = setTimeout ( ( ) => controller . abort ( ) , this . defaultArgs [ Constants . propNames . timeout ] || 5000 )
69
71
70
72
try {
71
73
const orsResponse = await this . fetchRequest ( body , controller )
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ class OrsGeocode extends OrsBase {
129
129
130
130
async geocodePromise ( ) {
131
131
const controller = new AbortController ( )
132
- const timeout = setTimeout ( ( ) => controller . abort ( 'timed out' ) , this . defaultArgs [ Constants . propNames . timeout ] || 5000 )
132
+ const timeout = setTimeout ( ( ) => controller . abort ( ) , this . defaultArgs [ Constants . propNames . timeout ] || 5000 )
133
133
134
134
try {
135
135
const orsResponse = await this . fetchGetRequest ( controller )
You can’t perform that action at this time.
0 commit comments