Skip to content

Commit

Permalink
Merge pull request from GHSA-mj35-2rgf-cv8p
Browse files Browse the repository at this point in the history
  • Loading branch information
maennchen committed Apr 3, 2024
1 parent 9bfc399 commit 2f304d8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/oidcc_provider_configuration_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,15 @@ lookup_in_ets_or_call(Name, Key, Call) ->

-spec get_ets_table_name(WorkerRef :: gen_server:server_ref()) ->
{ok, gen_server:server_ref()} | error.
get_ets_table_name(WorkerName) when is_atom(WorkerName) ->
{ok, erlang:list_to_atom(erlang:atom_to_list(WorkerName) ++ "_table")};
get_ets_table_name(Name) when is_atom(Name) ->
{ok, Name};
get_ets_table_name(_Ref) ->
error.

-spec register_ets_table(Opts :: opts()) -> ets:table() | undefined.
register_ets_table(Opts) ->
case maps:get(name, Opts, undefined) of
{local, WorkerName} ->
Name = erlang:list_to_atom(erlang:atom_to_list(WorkerName) ++ "_table"),
{local, Name} ->
ets:new(Name, [named_table, bag, protected, {read_concurrency, true}]);
_OtherName ->
undefined
Expand Down

0 comments on commit 2f304d8

Please sign in to comment.