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

Cancel oracle polling timer when a rescheduling is started #655

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/archethic/oracle_chain/scheduler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@ defmodule Archethic.OracleChain.Scheduler do
"Reschedule polling after reception of an oracle summary transaction in scheduled state instead of triggered state"
)

case Map.get(data, :polling_timer) do
nil ->
:skip

timer ->
Process.cancel_timer(timer)
end

new_data = update_summary_date(data)
{:next_state, :triggered, new_data, {:next_event, :internal, :fetch_data}}
end
Expand Down