@@ -105,13+105,17 @@ function submitValue(type,id,param,val)
if code ~= 200 and backlog_con then
printLog("writing record to backlog...")
if code ~= 200 and backlog_con then
printLog("writing record to backlog...")
+ backlog_con:execute('BEGIN TRANSACTION')
backlog_con:execute(string.format("INSERT INTO queue(time_stamp,sensor_id,sensor,param,value) VALUES (datetime('now','localtime'),'%s','%s','%s',%f)",id,type,param,val))
backlog_con:execute(string.format("INSERT INTO queue(time_stamp,sensor_id,sensor,param,value) VALUES (datetime('now','localtime'),'%s','%s','%s',%f)",id,type,param,val))
+ backlog_con:execute('COMMIT')
end
end
if logdb then
end
end
if logdb then
+ log_con:execute('BEGIN TRANSACTION')
log_con:execute(string.format("INSERT INTO log(time_stamp,sensor_id,sensor,param,value) VALUES (datetime('now','localtime'),'%s','%s','%s',%f)",id,type,param,val))
log_con:execute(string.format("INSERT INTO log(time_stamp,sensor_id,sensor,param,value) VALUES (datetime('now','localtime'),'%s','%s','%s',%f)",id,type,param,val))