mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-23 23:02:25 +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)
|
growth = self.growth(timespan)
|
||||||
print name, total_avail_space, growth
|
print name, total_avail_space, growth
|
||||||
if growth is not None:
|
if growth is not None:
|
||||||
try:
|
|
||||||
timeleft = total_avail_space / growth
|
|
||||||
except ZeroDivisionError:
|
|
||||||
timeleft = None
|
timeleft = None
|
||||||
|
if growth > 0:
|
||||||
|
timeleft = total_avail_space / growth
|
||||||
timespans.append( (name, timespan, growth, timeleft) )
|
timespans.append( (name, timespan, growth, timeleft) )
|
||||||
return timespans
|
return timespans
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user