diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/byteback/disk_free_history.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/byteback/disk_free_history.rb b/lib/byteback/disk_free_history.rb index ba66863..5ecc1c7 100755 --- a/lib/byteback/disk_free_history.rb +++ b/lib/byteback/disk_free_history.rb @@ -43,7 +43,7 @@ module Byteback # and less than the minimum interval. # return nil if @list.last && - @list.last.fsstat.blocks_available == reading.fsstat.blocks_available + @list.last.fsstat.blocks_available == reading.fsstat.blocks_available && Time.now - @list.last.time < MINIMUM_INTERVAL @list << reading @@ -96,7 +96,7 @@ module Byteback def save! list.shift while Time.now - list.first.time > MAXIMUM_AGE - tmp = "@history_file.#{$$}.#{rand(9999999999)}" + tmp = "@{history_file}.#{$$}.#{rand(9999999999)}" begin File.open(tmp, "w") do |fh| fh.write(Marshal.dump(list)) |