def cleanup(ctx):
"""
Cleanup old cache entries.
By default, entries older than 14 days will be removed. This value can be
overriden in the config file.
"""
settings = ctx.obj['settings']
# Manually configure logging since we don't have a CrawlerProcess which
# would take care of that.
configure_logging(settings)
if not settings.getbool('HTTPCACHE_ENABLED'):
logger.error('Cache is disabled, will not clean up cache dir.')
return 1
run_cleanup_cache(settings)
评论列表
文章目录