Skip to content

Commit

Permalink
fix: traffic record rate
Browse files Browse the repository at this point in the history
  • Loading branch information
若尘(樱の泪) committed Jan 15, 2019
1 parent d369cb9 commit f6aacee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ func UpdateTrafficByUser(users map[int]User) {
if v.Up+v.Down < 512*1024 {
continue
}
whenUp.WriteString(fmt.Sprintf(" WHEN %v THEN u+%v", v.Port, v.Up))
whenDown.WriteString(fmt.Sprintf(" WHEN %v THEN d+%v", v.Port, v.Down))
whenUp.WriteString(fmt.Sprintf(" WHEN %v THEN u+%v", v.Port, float32(v.Up)*conf.Rate))
whenDown.WriteString(fmt.Sprintf(" WHEN %v THEN d+%v", v.Port, float32(v.Down)*conf.Rate))
whenPort.WriteString(fmt.Sprintf("%v,", v.Port))
traffic, err := datasize.HumanSize(v.Up + v.Down)
if err != nil {
Expand Down

0 comments on commit f6aacee

Please sign in to comment.