mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-02-09 08:44:16 +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":
|
elif typ == "ZVEI":
|
||||||
#data = {"zvei":zvei_id}
|
#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":
|
elif typ == "POC":
|
||||||
#data = {"ric":poc_id, "function":poc_sub, "msg":poc_text}
|
#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)
|
logging.exception("cannot Insert %s", typ)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
logging.debug("close MySQL")
|
||||||
cursor.close()
|
cursor.close()
|
||||||
connection.close() #Close connection in every case
|
connection.close() #Close connection in every case
|
||||||
except:
|
except:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue