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

thinkjs 3.0中,本地mac电脑cluster模式,crontab任务在多个子进程中都执行 #1508

Open
licumt217 opened this issue Aug 28, 2020 · 1 comment

Comments

@licumt217
Copy link

根据官方文档,crontab配置中,type配置默认是one,也就是只在一个子进程执行。我按照官网文档写的代码,但是执行了多次。

ENV

OS Platform:mac

Node.js Version:10

ThinkJS Version:3

code

module.exports = [{
    interval: '10s',
    immediate: false,
    handle: () => {
        console.log(Math.random())
    },
}]

error message

// worker配置了2,控制台输出了两次

more description

// your detail description

@lizheming
Copy link
Contributor

新 new 了一个项目,然后用你的配置配置的 crontab 没有复现你说的问题,如果有问题的话提供个最小可复现的环境吧。

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants