File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
packages/client/lib/client Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -182,13 +182,21 @@ export default class EnterpriseMaintenanceManager {
182
182
183
183
dbgMaintenance ( "Creating new tmp client" ) ;
184
184
let start = performance . now ( ) ;
185
- const tmpClient = this . #client. duplicate ( {
186
- socket : {
187
- ...this . #options. socket ,
188
- host,
189
- port,
190
- } ,
191
- } ) ;
185
+
186
+ const tmpOptions = this . #options;
187
+ // If the URL is provided, it takes precedense
188
+ if ( tmpOptions . url ) {
189
+ const u = new URL ( tmpOptions . url ) ;
190
+ u . hostname = host ;
191
+ u . port = String ( port ) ;
192
+ tmpOptions . url = u . toString ( ) ;
193
+ } else {
194
+ tmpOptions . socket = {
195
+ ...tmpOptions . socket ,
196
+ host, port
197
+ }
198
+ }
199
+ const tmpClient = this . #client. duplicate ( tmpOptions ) ;
192
200
dbgMaintenance ( `Tmp client created in ${ ( performance . now ( ) - start ) . toFixed ( 2 ) } ms` ) ;
193
201
dbgMaintenance ( `Connecting tmp client: ${ host } :${ port } ` ) ;
194
202
start = performance . now ( ) ;
You can’t perform that action at this time.
0 commit comments