Disable the force GC if conn_force_gc_count = 0

This commit is contained in:
Feng Lee 2017-02-23 18:53:16 +08:00
parent 1e36750288
commit edd99dc5ed
2 changed files with 2 additions and 1 deletions

View File

@ -110,7 +110,7 @@ mqtt.max_packet_size = 64KB
## MQTT Connection
##--------------------------------------------------------------------
## Force GC: pos_integer
## Force GC: integer. Value 0 disabled the Force GC.
mqtt.conn.force_gc_count = 100
##--------------------------------------------------------------------

View File

@ -26,6 +26,7 @@
conn_max_gc_count() ->
case emqttd:env(conn_force_gc_count) of
{ok, I} when I > 0 -> I + rand:uniform(I);
{ok, I} when I =< 0 -> undefined;
undefined -> undefined
end.