diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-03-17 14:13:05 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-03-17 14:13:05 +0100 |
commit | a5c54449530aa558222a47354e7873b5203a3374 (patch) | |
tree | 046ad60aaf4120e16854a386e5ded7427d74ce48 /module/database/DatabaseBackend.py | |
parent | Added tag v0.4.5 for changeset 73cb51958a1d (diff) | |
download | pyload-a5c54449530aa558222a47354e7873b5203a3374.tar.xz |
closed #254
Diffstat (limited to 'module/database/DatabaseBackend.py')
-rw-r--r-- | module/database/DatabaseBackend.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/module/database/DatabaseBackend.py b/module/database/DatabaseBackend.py index 02e09b3b3..9e9e73e43 100644 --- a/module/database/DatabaseBackend.py +++ b/module/database/DatabaseBackend.py @@ -16,8 +16,6 @@ @author: RaNaN @author: mkaay """ - -from threading import Lock from threading import Thread from threading import Event from os import remove @@ -97,7 +95,11 @@ class DatabaseJob(): try: self.result = self.f(*self.args, **self.kwargs) except Exception, e: - print "Database Error @", self.f.__name__, self.args[1:], self.kwargs, e + try: + print "Database Error @", self.f.__name__, self.args[1:], self.kwargs, e + except: + pass + print_exc() self.exception = e finally: @@ -147,10 +149,6 @@ class DatabaseBackend(Thread): self.conn.close() break j.processJob() - if j.exception: - self.conn.rollback() - else: - self.conn.commit() @style.queue def shutdown(self): @@ -259,6 +257,10 @@ class DatabaseBackend(Thread): @style.async def commit(self): self.conn.commit() + + @style.queue + def syncSave(self): + self.conn.commit() @style.async def rollback(self): |