mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-28 13:42:36 +01:00
Fixed a bug in ChannelDBHandler that *somehow* would cause a wrong database to be returned from getDb.
This commit is contained in:
parent
d83cf1450f
commit
e7fd4cafbb
@ -116,8 +116,10 @@ class ChannelDBHandler(object):
|
||||
|
||||
def getDb(self, channel):
|
||||
"""Use this to get a database for a specific channel."""
|
||||
if channel not in self.dbCache or \
|
||||
threading.currentThread() is not world.mainThread:
|
||||
currentThread = threading.currentThread()
|
||||
if channel not in self.dbCache and currentThread == world.mainThread:
|
||||
self.dbCache[channel] = self.makeDb(self.makeFilename(channel))
|
||||
if currentThread != world.mainThread:
|
||||
db = self.makeDb(self.makeFilename(channel))
|
||||
else:
|
||||
db = self.dbCache[channel]
|
||||
|
Loading…
Reference in New Issue
Block a user