|
|
@ -13,15 +13,17 @@ defmodule Explorer.Chain.BlockNumberCache do |
|
|
|
|
|
|
|
|
|
|
|
@spec setup(Keyword.t()) :: :ok |
|
|
|
@spec setup(Keyword.t()) :: :ok |
|
|
|
def setup(opts \\ []) do |
|
|
|
def setup(opts \\ []) do |
|
|
|
|
|
|
|
if :ets.whereis(@tab) == :undefined do |
|
|
|
:ets.new(@tab, [ |
|
|
|
:ets.new(@tab, [ |
|
|
|
:set, |
|
|
|
:set, |
|
|
|
:named_table, |
|
|
|
:named_table, |
|
|
|
:public, |
|
|
|
:public, |
|
|
|
write_concurrency: true |
|
|
|
write_concurrency: true |
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
update_cache() |
|
|
|
|
|
|
|
setup_opts(opts) |
|
|
|
setup_opts(opts) |
|
|
|
|
|
|
|
update_cache() |
|
|
|
|
|
|
|
|
|
|
|
:ok |
|
|
|
:ok |
|
|
|
end |
|
|
|
end |
|
|
|