Skip to content

Commit

Permalink
Allow setting limit in app env
Browse files Browse the repository at this point in the history
  • Loading branch information
chrzaszcz committed Feb 8, 2024
1 parent 7f5568f commit 5f6188a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/erlang_doctor.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[kernel,
stdlib
]},
{env,[]},
{env, [{limit, infinity}]},
{modules, []},
{maintainers, []},
{licenses, ["Apache 2.0"]},
Expand Down
4 changes: 3 additions & 1 deletion src/tr.erl
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,9 @@ ts(#tr{ts = TS}) -> calendar:system_time_to_rfc3339(TS, [{unit, microsecond}]).
-spec init(init_options()) -> {ok, state()}.
init(Opts) ->
process_flag(trap_exit, true),
Defaults = #{tab => default_tab(), index => initial_index(), limit => infinity},
Defaults = #{tab => default_tab(),
index => initial_index(),
limit => application:get_env(erlang_doctor, limit, infinity)},
FinalOpts = #{tab := Tab} = maps:merge(Defaults, Opts),
State = maps:merge(FinalOpts, #{trace => none, tracer_pid => none}),
create_tab(Tab),
Expand Down

0 comments on commit 5f6188a

Please sign in to comment.