File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ interface ConfigConstructor {
11
11
terminalApiLocalEndpoint ?: string ;
12
12
}
13
13
14
+ const DEFAULT_TIMEOUT = 30000 ; // Default timeout value (30 sec)
15
+
14
16
class Config {
15
17
public username ?: string ;
16
18
public password ?: string ;
@@ -31,7 +33,8 @@ class Config {
31
33
if ( options . marketPayEndpoint ) this . marketPayEndpoint = options . marketPayEndpoint ;
32
34
if ( options . applicationName ) this . applicationName = options . applicationName ;
33
35
if ( options . apiKey ) this . apiKey = options . apiKey ;
34
- if ( options . connectionTimeoutMillis ) this . connectionTimeoutMillis = options . connectionTimeoutMillis || 30000 ;
36
+ // Set the timeout to DEFAULT_TIMEOUT if not provided
37
+ this . connectionTimeoutMillis = options . connectionTimeoutMillis ?? DEFAULT_TIMEOUT ;
35
38
if ( options . certificatePath ) this . certificatePath = options . certificatePath ;
36
39
if ( options . terminalApiCloudEndpoint ) this . terminalApiCloudEndpoint = options . terminalApiCloudEndpoint ;
37
40
if ( options . terminalApiLocalEndpoint ) this . terminalApiLocalEndpoint = options . terminalApiLocalEndpoint ;
You can’t perform that action at this time.
0 commit comments