mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 13:07:56 +00:00
diskwatcher.tac: don't report negative timeleft
This commit is contained in:
parent
7502971df6
commit
f77af25ef7
@ -160,10 +160,9 @@ class DiskWatcher(service.MultiService, resource.Resource):
|
||||
growth = self.growth(timespan)
|
||||
print name, total_avail_space, growth
|
||||
if growth is not None:
|
||||
try:
|
||||
timeleft = total_avail_space / growth
|
||||
except ZeroDivisionError:
|
||||
timeleft = None
|
||||
if growth > 0:
|
||||
timeleft = total_avail_space / growth
|
||||
timespans.append( (name, timespan, growth, timeleft) )
|
||||
return timespans
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user