do not do work in process initialization

pull/1493/head
Ayrat Badykov 6 years ago
parent 97348c82ee
commit c0a9b2e36b
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  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