Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

定时任务关联爬虫和节点 #244

Closed
wo10378931 opened this issue Oct 8, 2019 · 1 comment
Closed

定时任务关联爬虫和节点 #244

wo10378931 opened this issue Oct 8, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@wo10378931
Copy link
Contributor

定时任务关联着爬虫和节点,使用的绑定关系是使用ID,这种情况下当爬虫更新或者节点更新,会在某些情况下删除并重建,导致定时任务找不到对应的爬虫或者节点。

考虑使用的处理方式:
1、爬虫使用爬虫名称来关联
2、节点使用节点的KEY值来关联

@wo10378931 wo10378931 added the bug Something isn't working label Oct 8, 2019
@wo10378931
Copy link
Contributor Author

对于定时任务做了一下处理,在新增和编辑的时候都会检测cron表达式是否正确。
新增的时候,会把spider_name和node_key都写入定时任务。

定时任务进行任务调度的时候,会根据node_key和spider_name找到对应的node_id和spider_id,然后设置到task对象中。

已修复,未发布

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant