From 041a95f3af233ecd8f2817de784c97ca78449bef Mon Sep 17 00:00:00 2001 From: iou1name Date: Tue, 19 Mar 2019 07:03:37 -0400 Subject: [PATCH] maybe fix the unordered dick bug --- modules/seen.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/seen.py b/modules/seen.py index 729764a..1467c45 100755 --- a/modules/seen.py +++ b/modules/seen.py @@ -140,6 +140,7 @@ def dump_seen_db(bot): @hook(True) @require_chanmsg def seen_hook(bot, trigger): + bot.memory["seen_lock"].acquire() last = (time.time(), trigger.channel, trigger.group(0)) if not trigger.nick in bot.memory["seen"]: first = (time.time(), trigger.channel, trigger.group(0)) @@ -147,6 +148,7 @@ def seen_hook(bot, trigger): first = bot.memory["seen"][trigger.nick][:3] seen = first + last bot.memory["seen"][trigger.nick] = seen + bot.memory["seen_lock"].release() if time.time() - bot.memory["seen_last_dump"] > 1: # only dump once a minute at most