Skip to content

Commit e5aede7

Browse files
fix: limitless router weight rounding error (#557)
1 parent 36d6d20 commit e5aede7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/lib/plugins/limitless/limitless_query_helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class LimitlessQueryHelper {
4545
const hostName: string = row["router_endpoint"];
4646
const cpu: number = row["load"];
4747

48-
let weight: number = Math.round(10 - cpu * 10);
48+
let weight: number = 10 - Math.floor(cpu * 10);
4949

5050
if (weight < 1 || weight > 10) {
5151
weight = 1; // default to 1

0 commit comments

Comments
 (0)