-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
only run one instance 'cron.run()' #46
Comments
So is this a question or a statement? |
I mean |
@winxxp thanks. That makes sense. Probably the func (c *Cron) Start() {
if c.running {
return
}
c.running = true
go c.run()
} |
thread-safe better. |
Is there a good reason your application can't call Or are you saying, in case a poorly behaved application calls |
I used zookeeper to elect master, when network broken or other slave online, all node recvived new nodes to elect new leader, if leader call start, or stop, sometime the elected reslt is the leader node also leader node, so it call twice or more. Now I protected it out Start/Stop self. |
If call twice
The text was updated successfully, but these errors were encountered: