fix: Indexer memory limit for api instance (#11066)

pull/11013/merge
Qwerty5Uiop 3 weeks ago committed by GitHub
parent ab7eddd3d0
commit 9b943cc9dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      apps/indexer/lib/indexer/memory/monitor.ex

@ -47,10 +47,16 @@ defmodule Indexer.Memory.Monitor do
@impl GenServer
def init(options) when is_map(options) do
state = struct!(__MODULE__, Map.put_new(options, :limit, define_memory_limit()))
{:ok, timer_reference} = :timer.send_interval(state.timer_interval, :check)
case Application.get_env(:explorer, :mode) do
:api ->
:ignore
{:ok, %__MODULE__{state | timer_reference: timer_reference}}
_other_mode ->
state = struct!(__MODULE__, Map.put_new(options, :limit, define_memory_limit()))
{:ok, timer_reference} = :timer.send_interval(state.timer_interval, :check)
{:ok, %__MODULE__{state | timer_reference: timer_reference}}
end
end
@impl GenServer

Loading…
Cancel
Save