Attempt to solve the atexit-closed-database problem.

This commit is contained in:
Jeremy Fincher 2003-09-01 08:40:41 +00:00
parent 8b1a47b295
commit 3fd04637af

View File

@ -146,9 +146,10 @@ class FunDB(callbacks.Privmsg):
callbacks.Privmsg.__init__(self)
self.db = makeDb(dbFilename)
cursor = self.db.cursor()
started = int(world.startedAt)
cursor.execute("""INSERT INTO uptime VALUES (%s, NULL)""", started)
self.db.commit()
atexit.register(uptimeEnder(int(world.startedAt)))
atexit.register(uptimeEnder(started))
def die(self):
self.db.commit()