Make Chart plugin compatible with db changes

This commit is contained in:
shortcutme 2019-11-27 03:07:44 +01:00
parent fca9db7972
commit f7c767c1c8
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 6 additions and 8 deletions

View file

@ -146,8 +146,7 @@ class ChartCollector(object):
s = time.time()
cur = self.db.getCursor()
cur.cursor.executemany("INSERT INTO data (type_id, value, date_added) VALUES (?, ?, ?)", values)
cur.close()
cur.executemany("INSERT INTO data (type_id, value, date_added) VALUES (?, ?, ?)", values)
self.log.debug("Global collectors inserted in %.3fs" % (time.time() - s))
def collectSites(self, sites, collectors, last_values):
@ -163,8 +162,7 @@ class ChartCollector(object):
s = time.time()
cur = self.db.getCursor()
cur.cursor.executemany("INSERT INTO data (type_id, site_id, value, date_added) VALUES (?, ?, ?, ?)", values)
cur.close()
cur.executemany("INSERT INTO data (type_id, site_id, value, date_added) VALUES (?, ?, ?, ?)", values)
self.log.debug("Site collectors inserted in %.3fs" % (time.time() - s))
def collector(self):