Moved creation of cache directory so that it is created consistently
This commit is contained in:
parent
6cc797ce0a
commit
7dd301cdf4
@ -288,6 +288,8 @@ def http_cache_directory():
|
|||||||
if parser.has_option('Planet', 'http_cache_directory'):
|
if parser.has_option('Planet', 'http_cache_directory'):
|
||||||
os.path.join(cache_directory(),
|
os.path.join(cache_directory(),
|
||||||
parser.get('Planet', 'http_cache_directory'))
|
parser.get('Planet', 'http_cache_directory'))
|
||||||
|
else:
|
||||||
|
return os.path.join(cache_directory(), "cache")
|
||||||
|
|
||||||
def cache_sources_directory():
|
def cache_sources_directory():
|
||||||
if parser.has_option('Planet', 'cache_sources_directory'):
|
if parser.has_option('Planet', 'cache_sources_directory'):
|
||||||
|
@ -355,11 +355,13 @@ def spiderPlanet(only_if_new = False):
|
|||||||
parse_queue = Queue()
|
parse_queue = Queue()
|
||||||
|
|
||||||
threads = {}
|
threads = {}
|
||||||
if int(config.spider_threads()):
|
|
||||||
http_cache = config.http_cache_directory()
|
http_cache = config.http_cache_directory()
|
||||||
|
# Should this be done in config?
|
||||||
if http_cache and not os.path.exists(http_cache):
|
if http_cache and not os.path.exists(http_cache):
|
||||||
os.makedirs(http_cache, 0700)
|
os.makedirs(http_cache)
|
||||||
|
|
||||||
|
|
||||||
|
if int(config.spider_threads()):
|
||||||
# Start all the worker threads
|
# Start all the worker threads
|
||||||
for i in range(int(config.spider_threads())):
|
for i in range(int(config.spider_threads())):
|
||||||
threads[i] = Thread(target=httpThread,
|
threads[i] = Thread(target=httpThread,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user