Fix: genserver code
This commit is contained in:
parent
fa05cd3b91
commit
2c4a666c64
1 changed files with 3 additions and 3 deletions
|
@ -15,14 +15,14 @@ defmodule Jobs do
|
|||
{:ok, init, {:continue, :work}}
|
||||
end
|
||||
|
||||
# Exec the job for the first time, at the end of init
|
||||
# Exec job on continue, then reschedule
|
||||
def handle_continue(:work, state) do
|
||||
{:noreply, work_then_reschedule(state)}
|
||||
end
|
||||
|
||||
# Exec the job when :work message is received
|
||||
# Handle info and pass it to continue
|
||||
def handle_info(:work, state) do
|
||||
{:noreply, work_then_reschedule(state)}
|
||||
{:noreply, state, {:continue, :work}}
|
||||
end
|
||||
|
||||
# Get timer from config.exs
|
||||
|
|
Loading…
Reference in a new issue