Remove json_rpc_named_arguments from token_instance fetchers

pull/7286/head
Nikita Pozdniakov 2 years ago
parent 42c666a18d
commit 623e6a2d1e
No known key found for this signature in database
GPG Key ID: F344106F9804FE5F
  1. 12
      apps/indexer/lib/indexer/fetcher/token_instance/realtime.ex
  2. 12
      apps/indexer/lib/indexer/fetcher/token_instance/retry.ex
  3. 12
      apps/indexer/lib/indexer/fetcher/token_instance/sanitize.ex
  4. 15
      apps/indexer/lib/indexer/supervisor.ex

@ -18,18 +18,10 @@ defmodule Indexer.Fetcher.TokenInstance.Realtime do
@doc false
def child_spec([init_options, gen_server_options]) do
{state, mergeable_init_options} = Keyword.pop(init_options, :json_rpc_named_arguments)
unless state do
raise ArgumentError,
":json_rpc_named_arguments must be provided to `#{__MODULE__}.child_spec " <>
"to allow for json_rpc calls when running."
end
merged_init_opts =
defaults()
|> Keyword.merge(mergeable_init_options)
|> Keyword.put(:state, state)
|> Keyword.merge(init_options)
|> Keyword.merge(state: [])
Supervisor.child_spec({BufferedTask, [{__MODULE__, merged_init_opts}, gen_server_options]}, id: __MODULE__)
end

@ -18,18 +18,10 @@ defmodule Indexer.Fetcher.TokenInstance.Retry do
@doc false
def child_spec([init_options, gen_server_options]) do
{state, mergeable_init_options} = Keyword.pop(init_options, :json_rpc_named_arguments)
unless state do
raise ArgumentError,
":json_rpc_named_arguments must be provided to `#{__MODULE__}.child_spec " <>
"to allow for json_rpc calls when running."
end
merged_init_opts =
defaults()
|> Keyword.merge(mergeable_init_options)
|> Keyword.put(:state, state)
|> Keyword.merge(init_options)
|> Keyword.merge(state: [])
Supervisor.child_spec({BufferedTask, [{__MODULE__, merged_init_opts}, gen_server_options]}, id: __MODULE__)
end

@ -17,18 +17,10 @@ defmodule Indexer.Fetcher.TokenInstance.Sanitize do
@default_max_concurrency 10
@doc false
def child_spec([init_options, gen_server_options]) do
{state, mergeable_init_options} = Keyword.pop(init_options, :json_rpc_named_arguments)
unless state do
raise ArgumentError,
":json_rpc_named_arguments must be provided to `#{__MODULE__}.child_spec " <>
"to allow for json_rpc calls when running."
end
merged_init_opts =
defaults()
|> Keyword.merge(mergeable_init_options)
|> Keyword.put(:state, state)
|> Keyword.merge(init_options)
|> Keyword.merge(state: [])
Supervisor.child_spec({BufferedTask, [{__MODULE__, merged_init_opts}, gen_server_options]}, id: __MODULE__)
end

@ -109,18 +109,9 @@ defmodule Indexer.Supervisor do
{CoinBalance.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{Token.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{TokenInstanceRetry.Supervisor,
[
[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]
]},
{TokenInstanceRealtime.Supervisor,
[
[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]
]},
{TokenInstanceSanitize.Supervisor,
[
[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]
]},
{TokenInstanceRealtime.Supervisor, [[memory_monitor: memory_monitor]]},
{TokenInstanceRetry.Supervisor, [[memory_monitor: memory_monitor]]},
{TokenInstanceSanitize.Supervisor, [[memory_monitor: memory_monitor]]},
configure(TransactionAction.Supervisor, [[memory_monitor: memory_monitor]]),
{ContractCode.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},

Loading…
Cancel
Save