File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1384
1384
}
1385
1385
newTemplateSettings . routing . balancers . push ( tmpBalancer ) ;
1386
1386
this . templateSettings = newTemplateSettings ;
1387
- if ( balancer . strategy == 'leastPing' || balancer . strategy == 'leastLoad' )
1388
- this . updateObservatorySelectors ( ) ;
1387
+ this . updateObservatorySelectors ( ) ;
1389
1388
balancerModal . close ( ) ;
1390
1389
this . changeObsCode ( ) ;
1391
1390
} ,
1433
1432
} ) ;
1434
1433
}
1435
1434
this . templateSettings = newTemplateSettings ;
1436
- if ( balancer . strategy == 'leastPing' || balancer . strategy == 'leastLoad' )
1437
- this . updateObservatorySelectors ( ) ;
1435
+ this . updateObservatorySelectors ( ) ;
1438
1436
balancerModal . close ( ) ;
1439
1437
this . changeObsCode ( ) ;
1440
1438
} ,
1444
1442
updateObservatorySelectors ( ) {
1445
1443
newTemplateSettings = this . templateSettings ;
1446
1444
const leastPings = this . balancersData . filter ( ( b ) => b . strategy == 'leastPing' ) ;
1447
- const leastLoads = this . balancersData . filter ( ( b ) => b . strategy == 'leastLoad' ) ;
1445
+ const leastLoads = this . balancersData . filter ( ( b ) =>
1446
+ b . strategy === 'leastLoad' ||
1447
+ b . strategy === 'roundRobin' ||
1448
+ b . strategy === 'random'
1449
+ ) ;
1448
1450
if ( leastPings . length > 0 ) {
1449
1451
if ( ! newTemplateSettings . observatory )
1450
1452
newTemplateSettings . observatory = this . defaultObservatory ;
You can’t perform that action at this time.
0 commit comments