Added the option to !opt-in/opt-out [onlinebot only]
Fixed command & event threading Events are now threaded by event_type (i.e. all buddy_logon events get ran in the same one) Added default preferences Fixed recipe loading for multiple installs (i.e. on different machines)
This commit is contained in:
+3
-4
@@ -75,13 +75,12 @@ class DB:
|
||||
if string.__contains__("UPDATE ") or string.__contains__("INSERT "):
|
||||
conn.commit()
|
||||
except Exception as e:
|
||||
raise SqlException("SQL Error: '%s' for '%s' [%s]" % (
|
||||
str(e), sql, ", ".join(map(lambda x: str(x), params)))) from e
|
||||
raise SqlException( f"SQL Error: '{str(e)}' for '{sql}' "
|
||||
f"[{', '.join(map(lambda x: str(x), params))}]") from e
|
||||
elapsed = time.time() - start_time
|
||||
result = callback(cur)
|
||||
if elapsed > 5:
|
||||
self.logger.warning("slow query (%fs) '%s' for params: %s" % (elapsed, sql, str(params)))
|
||||
|
||||
self.logger.warning(f"slow query ({elapsed:f}s) '{sql}' for params: {str(params)}")
|
||||
return result
|
||||
|
||||
def query_single(self, sql, params=None, extended_like=False) -> DictObject:
|
||||
|
||||
Reference in New Issue
Block a user