Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Stop using OS environment variables for timer config.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Jan 18, 2014
1 parent 8fe0d74 commit 859f15a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
18 changes: 0 additions & 18 deletions src/logplex_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,6 @@ cache_os_envvars() ->
,{force_gc_memory, ["LOGPLEX_FORCE_GC_MEMORY"],
optional, %% in bytes
integer}
,{tcp_syslog_idle_timeout, ["LOGPLEX_TCP_IDLE_TIMEOUT"],
optional,
integer}
,{tcp_syslog_idle_fuzz, ["LOGPLEX_TCP_IDLE_FUZZ"],
optional,
integer}
,{tcp_syslog_max_ttl, ["LOGPLEX_TCP_MAX_TTL"],
optional,
integer}
,{http_drain_idle_timeout, ["LOGPLEX_HTTP_DRAIN_IDLE"],
optional,
integer}
,{http_drain_idle_fuzz, ["LOGPLEX_HTTP_IDLE_FUZZ"],
optional,
integer}
,{http_drain_max_ttl, ["LOGPLEX_HTTP_MAX_TTL"],
optional,
integer}
]),
ok.

Expand Down
10 changes: 6 additions & 4 deletions test/logplex_http_drain_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ init_per_testcase(restart_drain_buf, Config) ->
Tab = init_http_mocks(),
init_config(Config, Tab);
init_per_testcase(full_stack, Config) ->
application:set_env(logplex, http_drain_idle_timeout, 50),
application:set_env(logplex, http_drain_idle_fuzz, 1),
Tab = init_http_mocks(),
init_config(Config, Tab);
init_per_testcase(close_max_ttl, Config) ->
application:set_env(logplex, http_drain_idle_timeout, 50),
application:set_env(logplex, http_drain_idle_fuzz, 1),
application:set_env(logplex, http_drain_max_ttl, 100),
Tab = init_http_mocks(),
init_config(Config, Tab);
init_per_testcase(_, Config) ->
Expand Down Expand Up @@ -80,10 +85,7 @@ set_os_vars() ->
{"LOCAL_IP", "localhost"},
{"CLOUD_DOMAIN", "localhost"},
{"LOGPLEX_AUTH_KEY", uuid:to_string(uuid:v4())},
{"LOGPLEX_COOKIE", "ct test"},
{"LOGPLEX_HTTP_DRAIN_IDLE", "50"},
{"LOGPLEX_HTTP_IDLE_FUZZ", "1"},
{"LOGPLEX_HTTP_MAX_TTL", "100"}
{"LOGPLEX_COOKIE", "ct test"}
]].


Expand Down
8 changes: 4 additions & 4 deletions test/logplex_tcp_drain_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ init_per_testcase(shrink, Config) ->
with_tcp_server([{channel, 1337} | Config]);
init_per_testcase(_, Config) ->
application:set_env(logplex, tcp_drain_buffer_size, 5),
application:set_env(logplex, tcp_syslog_idle_timeout, 50),
application:set_env(logplex, tcp_syslog_idle_fuzz, 1),
application:set_env(logplex, tcp_syslog_max_ttl, 100),
Port = start_server(Config),
%% Drain data
ChannelId = 1337,
Expand Down Expand Up @@ -90,10 +93,7 @@ set_os_vars() ->
{"LOCAL_IP", "localhost"},
{"CLOUD_DOMAIN", "localhost"},
{"LOGPLEX_AUTH_KEY", uuid:to_string(uuid:v4())},
{"LOGPLEX_COOKIE", "ct test"},
{"LOGPLEX_TCP_IDLE_TIMEOUT", "50"},
{"LOGPLEX_TCP_MAX_TTL", "100"},
{"LOGPLEX_TCP_IDLE_FUZZ", "1"}
{"LOGPLEX_COOKIE", "ct test"}
]],
logplex_app:cache_os_envvars().

Expand Down

0 comments on commit 859f15a

Please sign in to comment.