Merge pull request #1493 from poanetwork/ab-fix-failed_created_addresses-process

do not do work in process initialization
pull/1510/head
Ayrat Badykov 6 years ago committed by GitHub
commit 3979325e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      apps/indexer/lib/indexer/temporary/failed_created_addresses.ex

@ -21,11 +21,22 @@ defmodule Indexer.Temporary.FailedCreatedAddresses do
@impl GenServer
def init(json_rpc_named_arguments) do
run(json_rpc_named_arguments)
schedule_work()
{:ok, json_rpc_named_arguments}
end
def schedule_work do
Process.send_after(self(), :run, 1_000)
end
@impl GenServer
def handle_info(:run, json_rpc_named_arguments) do
run(json_rpc_named_arguments)
{:noreply, json_rpc_named_arguments}
end
def run(json_rpc_named_arguments) do
Logger.debug(
[

Loading…
Cancel
Save