summaryrefslogtreecommitdiff
path: root/src/mod_vcard_xupdate.erl
diff options
context:
space:
mode:
authorEvgeny Khramtsov <ekhramtsov@process-one.net>2019-06-15 12:53:16 +0300
committerEvgeny Khramtsov <ekhramtsov@process-one.net>2019-06-15 12:53:16 +0300
commita205ebad2bd139c0d413a3aa85de045847c5228f (patch)
treee16731302ff2b4b7f7366f98166d25b256fb387b /src/mod_vcard_xupdate.erl
parentRemove default_db/1 and add default_db/3 (diff)
Get rid of "well-known" type
Diffstat (limited to 'src/mod_vcard_xupdate.erl')
-rw-r--r--src/mod_vcard_xupdate.erl13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mod_vcard_xupdate.erl b/src/mod_vcard_xupdate.erl
index 1cdfcff3..927ea959 100644
--- a/src/mod_vcard_xupdate.erl
+++ b/src/mod_vcard_xupdate.erl
@@ -160,10 +160,7 @@ init_cache(Host, Opts) ->
cache_opts(Opts) ->
MaxSize = mod_vcard_xupdate_opt:cache_size(Opts),
CacheMissed = mod_vcard_xupdate_opt:cache_missed(Opts),
- LifeTime = case mod_vcard_xupdate_opt:cache_life_time(Opts) of
- infinity -> infinity;
- I -> timer:seconds(I)
- end,
+ LifeTime = mod_vcard_xupdate_opt:cache_life_time(Opts),
[{max_size, MaxSize}, {cache_missed, CacheMissed}, {life_time, LifeTime}].
-spec use_cache(binary()) -> boolean().
@@ -192,13 +189,13 @@ compute_hash(VCard) ->
%% Options
%%====================================================================
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) ->
[{use_cache, ejabberd_option:use_cache(Host)},