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

In Elixir 1.6.4 timing is not correct #14

Open
shifters67 opened this issue Apr 16, 2018 · 1 comment
Open

In Elixir 1.6.4 timing is not correct #14

shifters67 opened this issue Apr 16, 2018 · 1 comment
Labels
Milestone

Comments

@shifters67
Copy link

In elixir 1.6.4 with Erlang 20.3 on windows;

Run every minute task runs every 30 seconds i.e. twice per minute.

A run every 5 minutes task runs twice in the first minute, then doesn't run until 5 minutes later but then runs twice within the same minute again etc

defmodule Core.Scheduler do
use Cronex.Scheduler
require Logger

every 5, :minute do
Logger.debug "Run every 5 minute task"
end

every :minute do
Logger.debug "Run every minute task"
end
end

@jbernardo95 jbernardo95 added this to the Version 0.5 milestone May 16, 2018
@TORIFUKUKaiou
Copy link
Contributor

TORIFUKUKaiou commented Nov 18, 2019

I meet the same issue.
I use Elixir 1.9.4 (compiled with Erlang/OTP 22).

The below shows my workaround.

mix.exs

def deps do
  [{:cronex, github: "jbernardo95/cronex", ref: "345b57e14667a08280d790afdfbb359f467649df"}]
end

config/config.exs

config :cronex,
  ping_interval: 60000
  • I guess that it causes twice in 1 minute 'cause Cronex.Table.ping_interval returns 30s.
  • I set 60s.

TORIFUKUKaiou added a commit to TORIFUKUKaiou/hello_nerves that referenced this issue Nov 18, 2019
This workaround works for me.
Please refer to jbernardo95/cronex#14 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants