V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
cheesea
V2EX  ›  Python

pyspider 暂停后,重新开始时是否会丢失部分任务?

  •  
  •   cheesea · 2017-11-14 10:37:33 +08:00 · 2874 次点击
    这是一个创建于 2316 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我大致看了下源码,每个 project 有一系列 task,task 的流程大概是:
    scheduler 从 new_task_queue 取 task 放到出队列 -> fetcher 执行 task 后把结果放到出队列 -> processor 把结果传给用户定义的 handler, 从中提取新的 task 放到 new_task_queue
    把 task 放到数据库是在 scheduler 取 task 的时候.如果在 processor 执行完后,设状态为 stop,这时候 scheduler 检测到爬虫停止了,是不会把 new_task_queue 中的 task 放到数据库的,这样会不会有丢失 task 的可能?
    3 条回复    2017-11-14 12:12:20 +08:00
    golmic
        1
    golmic  
       2017-11-14 11:46:29 +08:00
    不建议用 pyspider,很多坑。用 scrapy 吧
    cheesea
        2
    cheesea  
    OP
       2017-11-14 12:11:47 +08:00
    没有用,我只是在学习它的源码,和 scrapy 相互比较.
    cheesea
        3
    cheesea  
    OP
       2017-11-14 12:12:20 +08:00
    @golmic
    没有用,我只是在学习它的源码,和 scrapy 相互比较.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5950 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 02:02 · PVG 10:02 · LAX 19:02 · JFK 22:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.