diff options
author | Jay Doane <jaydoane@apache.org> | 2020-10-23 23:36:52 -0700 |
---|---|---|
committer | Jay Doane <jay.s.doane@gmail.com> | 2020-10-26 10:36:53 -0700 |
commit | 4c1980e9d890b4800193de4c7bb0072a2de2ad3b (patch) | |
tree | 5dcb72fa24023d352bb65e9d0902a85965a797e8 | |
parent | cc9e26191385c8fd357843f673a87a6552833ed7 (diff) | |
download | couchdb-4c1980e9d890b4800193de4c7bb0072a2de2ad3b.tar.gz |
Fix dialyzer warnings
Fix specs to eliminate dialyzer warnings.
-rw-r--r-- | src/couch_expiring_cache/.suppressed | 1 | ||||
-rw-r--r-- | src/couch_expiring_cache/src/couch_expiring_cache.erl | 5 | ||||
-rw-r--r-- | src/couch_expiring_cache/src/couch_expiring_cache_fdb.erl | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/couch_expiring_cache/.suppressed b/src/couch_expiring_cache/.suppressed new file mode 100644 index 000000000..3baad65f2 --- /dev/null +++ b/src/couch_expiring_cache/.suppressed @@ -0,0 +1 @@ +no_return diff --git a/src/couch_expiring_cache/src/couch_expiring_cache.erl b/src/couch_expiring_cache/src/couch_expiring_cache.erl index b26556e98..f1ce20276 100644 --- a/src/couch_expiring_cache/src/couch_expiring_cache.erl +++ b/src/couch_expiring_cache/src/couch_expiring_cache.erl @@ -31,8 +31,9 @@ insert(Name, Key, Value, StaleTS, ExpiresTS) insert(undefined, Name, Key, Value, StaleTS, ExpiresTS). --spec insert(Tx :: jtx(), Name :: binary(), Key :: binary(), Value :: binary(), - StaleTS :: ?TIME_UNIT(), ExpiresTS :: ?TIME_UNIT()) -> ok. +-spec insert(Tx :: jtx() | undefined, Name :: binary(), Key :: binary(), + Value :: binary(), StaleTS :: ?TIME_UNIT(), ExpiresTS :: ?TIME_UNIT()) -> ok. +-dialyzer({no_return, insert/6}). insert(Tx, Name, Key, Value, StaleTS, ExpiresTS) when is_binary(Name), is_binary(Key), is_binary(Value), is_integer(StaleTS), is_integer(ExpiresTS) -> diff --git a/src/couch_expiring_cache/src/couch_expiring_cache_fdb.erl b/src/couch_expiring_cache/src/couch_expiring_cache_fdb.erl index 7c4ad8f6f..3f6e1aa13 100644 --- a/src/couch_expiring_cache/src/couch_expiring_cache_fdb.erl +++ b/src/couch_expiring_cache/src/couch_expiring_cache_fdb.erl @@ -37,7 +37,7 @@ -spec insert(JTx :: jtx(), Name :: binary(), Key :: binary(), Value :: binary(), - StaleTS :: ?TIME_UNIT, ExpiresTS :: ?TIME_UNIT) -> ok. + StaleTS :: millisecond(), ExpiresTS :: millisecond()) -> ok. insert(#{jtx := true} = JTx, Name, Key, Val, StaleTS, ExpiresTS) -> #{tx := Tx, layer_prefix := LayerPrefix} = couch_jobs_fdb:get_jtx(JTx), PK = primary_key(Name, Key, LayerPrefix), @@ -86,7 +86,7 @@ clear_all(Name) -> end). --spec clear_range_to(Name :: binary(), EndTS :: ?TIME_UNIT, +-spec clear_range_to(Name :: binary(), EndTS :: millisecond(), Limit :: non_neg_integer()) -> OldestTS :: ?TIME_UNIT. clear_range_to(Name, EndTS, Limit) when Limit > 0 -> @@ -98,7 +98,7 @@ clear_range_to(Name, EndTS, Limit) when Limit > 0 -> end, 0). --spec get_range_to(Name :: binary(), EndTS :: ?TIME_UNIT, +-spec get_range_to(Name :: binary(), EndTS :: millisecond(), Limit :: non_neg_integer()) -> [{Key :: binary(), Val :: binary()}]. get_range_to(Name, EndTS, Limit) when Limit > 0 -> |