mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 22:51:01 +01:00
Attempt to solve the atexit-closed-database problem.
This commit is contained in:
parent
8b1a47b295
commit
3fd04637af
@ -146,9 +146,10 @@ class FunDB(callbacks.Privmsg):
|
|||||||
callbacks.Privmsg.__init__(self)
|
callbacks.Privmsg.__init__(self)
|
||||||
self.db = makeDb(dbFilename)
|
self.db = makeDb(dbFilename)
|
||||||
cursor = self.db.cursor()
|
cursor = self.db.cursor()
|
||||||
|
started = int(world.startedAt)
|
||||||
cursor.execute("""INSERT INTO uptime VALUES (%s, NULL)""", started)
|
cursor.execute("""INSERT INTO uptime VALUES (%s, NULL)""", started)
|
||||||
self.db.commit()
|
self.db.commit()
|
||||||
atexit.register(uptimeEnder(int(world.startedAt)))
|
atexit.register(uptimeEnder(started))
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
self.db.commit()
|
self.db.commit()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user