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

为什么同一时间任务会执行两次 #181

Open
liziqiang0523 opened this issue Nov 4, 2020 · 2 comments
Open

为什么同一时间任务会执行两次 #181

liziqiang0523 opened this issue Nov 4, 2020 · 2 comments

Comments

@liziqiang0523
Copy link

Please answer these questions before submitting your issue. Thanks!
在你提交 issue 前,请先回答以下问题,谢谢!

  1. What version of Go and cronsun version are you using?
    你用的是哪个版本的 Go 和 哪个版本的 cronsun?
    go version go1.11.5 和 v0.3.5 (build go1.11)

  2. What operating system and processor architecture are you using (go env)?
    你用的是哪个操作系统,什么架构的?
    linux/amd64

  3. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    你做了什么,遇到了什么问题?尽可能描述清楚问题,最好把操作步骤写下来,按这些步骤操作后能重现你的问题。
    在后台增加任务后, 从后台点立即执行,任务会执行两次。

  4. What did you expect to see?
    你期望得到什么样的结果?
    只执行一次

  5. What did you see instead?
    现在你得到的结果是什么样的?
    现在同一时间任务会重复执行。

@1iuyunpeng
Copy link

我也碰到了同样的问题,同一个任务再同一个节点执行了两次,两次执行时间相差了1S

@liziqiang0523
Copy link
Author

我找到了原因, 是因为启动了两个服务。

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