一、问题
由于爬虫报错/生产环境更换等原因造成定时的scrapy任务队列 pending 等待的太多
(通过http://127.0.0.1:6800/listjobs.json?project=myproject 查询到 pending 的爬虫队列竟然有600+....)
二、解决方案
进入 用户目录下-->dbs 目录,删除 pending 的scrapy项目db文件即可
因为 dbs 目录下存储着项目数据(包括爬虫任务队列)
如下图(scrapy项目为MyToken, 此处删除 MyToken.db)
注:查看scrapyd官方文档(https://scrapyd.readthedocs.io/en/stable/config.html),我们可以发现:
dbs_dir: The directory where the project databases will be stored (this includes the spider queues).
带有所有默认值的示例配置文件如下,默认在用户目录下
参考文档:https://scrapyd.readthedocs.io/en/stable/config.html
------------- END ------------