[fluksod] determine threshold based on current unix time

This commit is contained in:
Bart Van Der Meerssche 2011-04-06 15:36:11 +02:00
parent 5defc5b906
commit e41aa35ccc
1 changed files with 2 additions and 2 deletions

View File

@ -141,7 +141,7 @@ end
function wan_buffer(child)
return coroutine.create(function(sensor_id, timestamp, counter)
local measurements = data.new()
local threshold = timestamp + WAN_INTERVAL
local threshold = os.time() + WAN_INTERVAL
local previous = {}
while true do
@ -166,7 +166,7 @@ function wan_buffer(child)
if timestamp > threshold and next(measurements) then --checking whether table is not empty
coroutine.resume(child, measurements)
threshold = timestamp + WAN_INTERVAL
threshold = os.time() + WAN_INTERVAL
end
sensor_id, timestamp, counter = coroutine.yield()