summaryrefslogtreecommitdiffstats
path: root/module/database
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-03-17 14:13:05 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-03-17 14:13:05 +0100
commita5c54449530aa558222a47354e7873b5203a3374 (patch)
tree046ad60aaf4120e16854a386e5ded7427d74ce48 /module/database
parentAdded tag v0.4.5 for changeset 73cb51958a1d (diff)
downloadpyload-a5c54449530aa558222a47354e7873b5203a3374.tar.xz
closed #254
Diffstat (limited to 'module/database')
-rw-r--r--module/database/DatabaseBackend.py16
-rw-r--r--module/database/FileDatabase.py4
2 files changed, 9 insertions, 11 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):
diff --git a/module/database/FileDatabase.py b/module/database/FileDatabase.py
index 528bf666d..5c976eda4 100644
--- a/module/database/FileDatabase.py
+++ b/module/database/FileDatabase.py
@@ -756,10 +756,6 @@ class FileMethods():
def restartPackage(self, id):
self.c.execute('UPDATE links SET status=3 WHERE package=?', (str(id),))
- @style.async
- def syncSave(self):
- self.commit()
-
@style.queue
def getPackage(self, id):
"""return package instance from id"""