mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-02-09 00:34:17 +01:00
little error in mysql plugin
This commit is contained in:
parent
463bcefa81
commit
f5dba0318f
|
|
@ -33,7 +33,7 @@ def run(typ,freq,data):
|
|||
|
||||
elif typ == "ZVEI":
|
||||
#data = {"zvei":zvei_id}
|
||||
cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableZVEI")+" (time,zvei) VALUES (NOW(),"+data["zvei"]+")")
|
||||
cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableZVEI")+" (time,zvei) VALUES (NOW(),%s)",(data["zvei"]))
|
||||
|
||||
elif typ == "POC":
|
||||
#data = {"ric":poc_id, "function":poc_sub, "msg":poc_text}
|
||||
|
|
@ -45,6 +45,7 @@ def run(typ,freq,data):
|
|||
logging.exception("cannot Insert %s", typ)
|
||||
|
||||
finally:
|
||||
logging.debug("close MySQL")
|
||||
cursor.close()
|
||||
connection.close() #Close connection in every case
|
||||
except:
|
||||
|
|
|
|||
Loading…
Reference in a new issue