From fad63ef17f825df2d1a58cc64be8bb19fb8e561f Mon Sep 17 00:00:00 2001 From: Roman Bazalevsky Date: Sat, 25 Jan 2020 10:40:27 +0300 Subject: [PATCH] =?utf8?q?=D0=A2=D1=80=D0=B0=D0=BD=D0=B7=D0=B0=D0=BA=D1=86?= =?utf8?q?=D0=B8=D0=BE=D0=BD=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=BF=D1=80?= =?utf8?q?=D0=B8=20=D0=BA=D0=BE=D1=80=D0=BE=D1=82=D0=BA=D0=B8=D1=85=20?= =?utf8?q?=D1=81=D0=B5=D1=81=D1=81=D0=B8=D1=8F=D1=85=20=D1=81=20=D0=91?= =?utf8?q?=D0=94=20=D0=BD=D0=B5=20=D1=82=D1=80=D0=B5=D0=B1=D1=83=D0=B5?= =?utf8?q?=D1=82=D1=81=D1=8F,=20=D0=B2=D1=81=D0=B5=20=D0=B2=20=D0=BE=D0=B4?= =?utf8?q?=D0=BD=D1=83=20=D0=BE=D0=BF=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D1=8E.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/weathermon | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bin/weathermon b/bin/weathermon index 2c5419c..c789bea 100755 --- a/bin/weathermon +++ b/bin/weathermon @@ -114,9 +114,7 @@ function submitValue(type,id,param,val) if code ~= 200 and backlogdb then printLog("writing record to backlog...") local backlog_con = assert(env:connect(backlogdb)) - 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)) - local n,err = backlog_con:execute('COMMIT TRANSACTION') + local n,err = 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:close() if err == "LuaSQL: database is locked" then @@ -130,13 +128,9 @@ function submitValue(type,id,param,val) if logdb then print(logdb) local log_con = assert(env:connect(logdb)) - 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)) - local n,err = log_con:execute('COMMIT TRANSACTION') + local n,err = 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:close() - print(n,err) - if err == "LuaSQL: database is locked" then unlock_db(logdb); end -- 2.34.1