Skip to content
Snippets Groups Projects
Commit d5caaf5a authored by Will Rouesnel's avatar Will Rouesnel
Browse files

Fix issue #174

Postgres can emit 32MB and 64MB units which were previously unhandled. Handle them.
parent 771eb94e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -96,7 +96,7 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) {
return
case "ms", "s", "min", "h", "d":
unit = "seconds"
case "kB", "MB", "GB", "TB", "8kB", "16kB", "32kB", "16MB":
case "kB", "MB", "GB", "TB", "8kB", "16kB", "32kB", "16MB", "32MB", "64MB":
unit = "bytes"
default:
err = fmt.Errorf("Unknown unit for runtime variable: %q", s.unit)
Loading
Loading
@@ -134,6 +134,12 @@ func (s *pgSetting) normaliseUnit() (val float64, unit string, err error) {
case "16MB":
val *= math.Pow(2, 24)
}
case "32MB":
val *= math.Pow(2, 25)
}
case "64MB":
val *= math.Pow(2, 26)
}
 
return
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment