From 3c92dcb77302b9732c89215e30d9407856fc9d44 Mon Sep 17 00:00:00 2001 From: linuxdaemon Date: Fri, 5 Jan 2018 12:06:10 -0600 Subject: [PATCH] Fix possible issues in duckhunt.save_status where it keeps the db locked for too long --- plugins/duckhunt.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/duckhunt.py b/plugins/duckhunt.py index d19f20274..305e4c584 100644 --- a/plugins/duckhunt.py +++ b/plugins/duckhunt.py @@ -4,7 +4,6 @@ from time import time from sqlalchemy import Table, Column, String, Integer, PrimaryKeyConstraint, desc, Boolean -from sqlalchemy.exc import DatabaseError from sqlalchemy.sql import select from cloudbot import hook @@ -108,7 +107,7 @@ def save_status(db): if not res.rowcount: db.execute(status_table.insert().values(network=network, chan=chan, active=active, duck_kick=duck_kick)) - db.commit() + db.commit() @hook.event([EventType.message, EventType.action], singlethread=True)