diff options
author | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-07-17 22:58:14 +0300 |
---|---|---|
committer | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-07-17 22:58:14 +0300 |
commit | dd301306d3580510a4b2e292e1fe82afcae6f21f (patch) | |
tree | eb5b889de5a40d6470c0b09826cf775755914d0e /src/mod_mqtt.erl | |
parent | Use econf:timeout() instead of econf:pos_int() wherever appropriate (diff) |
Allow flexible timeout format in session_expiry option of mod_mqtt
Diffstat (limited to 'src/mod_mqtt.erl')
-rw-r--r-- | src/mod_mqtt.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mod_mqtt.erl b/src/mod_mqtt.erl index c76d910a4..e0e0a58e3 100644 --- a/src/mod_mqtt.erl +++ b/src/mod_mqtt.erl @@ -204,7 +204,7 @@ mod_options(Host) -> [{match_retained_limit, 1000}, {max_topic_depth, 8}, {max_topic_aliases, 100}, - {session_expiry, 300}, + {session_expiry, timer:minutes(5)}, {max_queue, 5000}, {access_subscribe, []}, {access_publish, []}, @@ -219,7 +219,9 @@ mod_options(Host) -> mod_opt_type(max_queue) -> econf:pos_int(unlimited); mod_opt_type(session_expiry) -> - econf:non_neg_int(); + econf:either( + econf:int(0, 0), + econf:timeout(second)); mod_opt_type(match_retained_limit) -> econf:pos_int(infinity); mod_opt_type(max_topic_depth) -> |