diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-02 17:48:46 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-02 17:48:46 +0200 |
commit | 553c55113f322b18828333c62ed57aa82e252541 (patch) | |
tree | 64228f7bf8170f5e06d666bb49452a6d3f0a2f1a | |
parent | added several checks to improve stability (diff) | |
download | pyload-553c55113f322b18828333c62ed57aa82e252541.tar.xz |
check free space
-rw-r--r-- | module/ThreadManager.py | 8 |
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 |