Lua 5.3+ compat fixes

This commit is contained in:
Simone Mainardi 2018-11-26 14:57:58 +01:00
parent 5a9f75dd0a
commit 12d4f54c9e
4 changed files with 10 additions and 10 deletions

View file

@ -66,10 +66,10 @@ function queryEpochData(schema, tags, selectedEpoch, zoomLevel, options)
if((selectedEpoch == nil) or (selectedEpoch == "")) then
selectedEpoch = os.time()
end_time = tonumber(selectedEpoch)
start_time = end_time-d
start_time = end_time - d
else
end_time = tonumber(selectedEpoch) + d/2
start_time = tonumber(selectedEpoch) - d/2
end_time = tonumber(selectedEpoch) + math.floor(d / 2)
start_time = tonumber(selectedEpoch) - math.floor(d / 2)
end
return ts_utils.query(schema, tags, start_time, end_time, options)
@ -484,8 +484,8 @@ print[[
nextZoomLevel = zoom_vals[k-1][1]
end
if(epoch ~= nil) then
start_time = epoch - zoom_vals[k][3]/2
end_time = epoch + zoom_vals[k][3]/2
start_time = epoch - math.floor(zoom_vals[k][3] / 2)
end_time = epoch + math.floor(zoom_vals[k][3] / 2)
else
end_time = os.time()
start_time = end_time - zoom_vals[k][3]