diff options
author | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-06-15 12:53:16 +0300 |
---|---|---|
committer | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-06-15 12:53:16 +0300 |
commit | a205ebad2bd139c0d413a3aa85de045847c5228f (patch) | |
tree | e16731302ff2b4b7f7366f98166d25b256fb387b /src/mod_vcard.erl | |
parent | Remove default_db/1 and add default_db/3 (diff) |
Get rid of "well-known" type
Diffstat (limited to 'src/mod_vcard.erl')
-rw-r--r-- | src/mod_vcard.erl | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/mod_vcard.erl b/src/mod_vcard.erl index dc8e83879..a050a372e 100644 --- a/src/mod_vcard.erl +++ b/src/mod_vcard.erl @@ -497,10 +497,7 @@ init_cache(Mod, Host, Opts) -> cache_opts(_Host, Opts) -> MaxSize = mod_vcard_opt:cache_size(Opts), CacheMissed = mod_vcard_opt:cache_missed(Opts), - LifeTime = case mod_vcard_opt:cache_life_time(Opts) of - infinity -> infinity; - I -> timer:seconds(I) - end, + LifeTime = mod_vcard_opt:cache_life_time(Opts), [{max_size, MaxSize}, {cache_missed, CacheMissed}, {life_time, LifeTime}]. -spec use_cache(module(), binary()) -> boolean(). @@ -544,19 +541,19 @@ mod_opt_type(matches) -> mod_opt_type(search) -> econf:bool(); mod_opt_type(host) -> - econf:well_known(host, ?MODULE); + econf:host(); mod_opt_type(hosts) -> - econf:well_known(hosts, ?MODULE); + econf:hosts(); mod_opt_type(db_type) -> - econf:well_known(db_type, ?MODULE); + econf:db_type(?MODULE); mod_opt_type(use_cache) -> - econf:well_known(use_cache, ?MODULE); + econf:bool(); mod_opt_type(cache_size) -> - econf:well_known(cache_size, ?MODULE); + econf:pos_int(infinity); mod_opt_type(cache_missed) -> - econf:well_known(cache_missed, ?MODULE); + econf:bool(); mod_opt_type(cache_life_time) -> - econf:well_known(cache_life_time, ?MODULE). + econf:timeout(second, infinity). mod_options(Host) -> [{allow_return_all, false}, |