디스크가 4GB 이상 남았을 때만 Crawling

This commit is contained in:
2018-05-24 04:13:49 +09:00
parent 917894fcac
commit 9d7afbdc1b

View File

@@ -7,6 +7,7 @@ import os
from .Setting import Setting
from .ProxyHandler import ProxyHandler
from .Logger import Logger
from .Util import Util
class PageLink:
@@ -201,6 +202,10 @@ class Crawler:
self.download_files(file)
def crawl(self):
if Util.get_free_space() < 4*1024*1024:
Logger.log('Disk space is less than 4GB. Aborted')
return
Logger.log('Crawling start')
self.crawl_torrent()
Logger.log('Crawling finished')