Browse Source

Prevent negative numbers in dbinfo output.

This might occur if things change while we're calculating the sizes.
tags/nilmdb-1.9.4^0
Jim Paris 10 years ago
parent
commit
ccf1f695af
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      nilmdb/server/server.py

+ 2
- 2
nilmdb/server/server.py View File

@@ -74,8 +74,8 @@ class Root(NilmApp):
dbsize = nilmdb.utils.du(path)
return { "path": path,
"size": dbsize,
"other": usage.used - dbsize,
"reserved": usage.total - usage.used - usage.free,
"other": max(usage.used - dbsize, 0),
"reserved": max(usage.total - usage.used - usage.free, 0),
"free": usage.free }

class Stream(NilmApp):


Loading…
Cancel
Save