summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/FileDatabase.py3
-rw-r--r--module/PluginThread.py25
-rwxr-xr-xmodule/network/Request.py3
3 files changed, 22 insertions, 9 deletions
diff --git a/module/FileDatabase.py b/module/FileDatabase.py
index cbb72b416..bf7b768fe 100644
--- a/module/FileDatabase.py
+++ b/module/FileDatabase.py
@@ -514,12 +514,15 @@ class FileDatabaseBackend(Thread):
self.c = self.conn.cursor()
#self.c.execute("PRAGMA synchronous = OFF")
self._createTables()
+ self.c.close()
while True:
try:
f, args, async = self.jobs.get()
if f == "quit": return True
+ self.c = self.conn.cursor()
res = f(*args)
+ self.c.close()
if not async: self.res.put(res)
except Exception, e:
#@TODO log etc
diff --git a/module/PluginThread.py b/module/PluginThread.py
index ee5ebb0d5..0175bb419 100644
--- a/module/PluginThread.py
+++ b/module/PluginThread.py
@@ -140,6 +140,7 @@ class DownloadThread(PluginThread):
self.m.log.info(_("Download aborted: %s") % pyfile.name)
pyfile.setStatus("aborted")
+ pyfile.plugin.req.clean()
self.active = False
pyfile.release()
continue
@@ -172,6 +173,7 @@ class DownloadThread(PluginThread):
self.m.log.warning(_("Download failed: %s | %s") % (pyfile.name, msg))
pyfile.error = msg
+ pyfile.plugin.req.clean()
self.active = False
pyfile.release()
continue
@@ -190,6 +192,7 @@ class DownloadThread(PluginThread):
self.queue.put(pyfile)
continue
+ pyfile.plugin.req.clean()
self.active = False
pyfile.release()
continue
@@ -203,6 +206,7 @@ class DownloadThread(PluginThread):
print_exc()
self.writeDebugReport(pyfile)
+ pyfile.plugin.req.clean()
self.active = False
pyfile.release()
continue
@@ -213,6 +217,7 @@ class DownloadThread(PluginThread):
self.m.log.info(_("Download finished: %s") % pyfile.name)
+ pyfile.plugin.req.clean()
self.m.core.hookManager.downloadFinished(pyfile)
@@ -362,11 +367,15 @@ class InfoThread(PluginThread):
for pluginname, urls in plugins.iteritems():
plugin = self.m.core.pluginManager.getPlugin(pluginname)
if hasattr(plugin, "getInfo"):
- self.m.core.log.debug("Run Info Fetching for %s" % pluginname)
- for result in plugin.getInfo(urls):
- if not type(result) == list: result = [result]
- self.m.core.files.updateFileInfo(result, self.pid)
-
- self.m.core.log.debug("Finished Info Fetching for %s" % pluginname)
-
- self.m.core.files.save()
+ try:
+ self.m.core.log.debug("Run Info Fetching for %s" % pluginname)
+ for result in plugin.getInfo(urls):
+ if not type(result) == list: result = [result]
+ self.m.core.files.updateFileInfo(result, self.pid)
+
+ self.m.core.log.debug("Finished Info Fetching for %s" % pluginname)
+
+ self.m.core.files.save()
+ except Exception, e:
+ self.m.core.log.debug("Info Fetching for %s failed | %s" % (pluginname,str) )
+ \ No newline at end of file
diff --git a/module/network/Request.py b/module/network/Request.py
index 45fd3f66b..75a490b9f 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -77,7 +77,7 @@ class Request:
def init_curl(self):
self.rep = StringIO()
self.header = ""
-
+
self.pycurl = pycurl.Curl()
self.pycurl.setopt(pycurl.FOLLOWLOCATION, 1)
self.pycurl.setopt(pycurl.MAXREDIRS, 5)
@@ -90,6 +90,7 @@ class Request:
self.pycurl.setopt(pycurl.HEADERFUNCTION, self.write_header)
self.pycurl.setopt(pycurl.BUFFERSIZE, self.bufferSize)
self.pycurl.setopt(pycurl.SSL_VERIFYPEER, 0)
+
if self.debug:
self.pycurl.setopt(pycurl.VERBOSE, 1)
if self.interface and self.interface.lower() != "none":