summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-02 17:48:46 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-02 17:48:46 +0200
commit553c55113f322b18828333c62ed57aa82e252541 (patch)
tree64228f7bf8170f5e06d666bb49452a6d3f0a2f1a /module
parentadded several checks to improve stability (diff)
downloadpyload-553c55113f322b18828333c62ed57aa82e252541.tar.xz
check free space
Diffstat (limited to 'module')
-rw-r--r--module/ThreadManager.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/module/ThreadManager.py b/module/ThreadManager.py
index 0a7408ecf..fd47fada2 100644
--- a/module/ThreadManager.py
+++ b/module/ThreadManager.py
@@ -30,6 +30,7 @@ import pycurl
import PluginThread
from module.network.RequestFactory import getURL
+from module.utils import freeSpace
########################################################################
class ThreadManager:
@@ -235,7 +236,12 @@ class ThreadManager:
return
if job.plugin.__type__ == "hoster":
- if free:
+ spaceLeft = freeSpace(self.core.config["general"]["download_folder"]) / 1024 / 1024
+ if spaceLeft < self.core.config["general"]["min_free_space"]:
+ self.log.warning(_("Not enough space left on device"))
+ self.pause = True
+
+ if free and not self.pause:
thread = free[0]
#self.downloaded += 1