duty-machine / duty-machine-action

抓取网络文章到github issue保存的github action
68 stars 54 forks source link

优化performTasks #9

Closed ghost closed 3 years ago

ghost commented 3 years ago

场景:同时存在多个未抓取issue时,最终完成抓取结果中的每个issue会产生N个comment,例如:#3009#3010#3011#3012每个issue都会产生4个comment。

问题原因:perform.js#L22-L26一次性列出所有已提交的新issue,每个执行都遍历执行一次issue https://github.com/duty-machine/duty-machine-action/blob/8875ceb39f9a1d78650c544a95d246099658c881/perform.js#L22-L26

解决方案:增加label判断抓取状态,在执行fetchArticle前跳过正在抓取的任务,给未抓取的任务增加正在抓取标签,仅供参考。https://github.com/duty-machine/duty-machine-action/blob/8875ceb39f9a1d78650c544a95d246099658c881/perform.js#L33

duty-machine commented 3 years ago

已加