diff options
Diffstat (limited to 'src/couchdb/couch_stats_collector.erl')
-rw-r--r-- | src/couchdb/couch_stats_collector.erl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/couchdb/couch_stats_collector.erl b/src/couchdb/couch_stats_collector.erl index 8d0234bb..854fffb0 100644 --- a/src/couchdb/couch_stats_collector.erl +++ b/src/couchdb/couch_stats_collector.erl @@ -56,13 +56,17 @@ increment({Module, Key}) when is_integer(Key) -> increment({Module, list_to_atom(integer_to_list(Key))}); increment(Key) -> case catch ets:update_counter(?HIT_COUNTER_TABLE, Key, 1) of - {'EXIT', {badarg, _}} -> ets:insert(?HIT_COUNTER_TABLE, {Key, 1}); + {'EXIT', {badarg, _}} -> + true = ets:insert(?HIT_COUNTER_TABLE, {Key, 1}), + ok; _ -> ok end. decrement(Key) -> case catch ets:update_counter(?HIT_COUNTER_TABLE, Key, -1) of - {'EXIT', {badarg, _}} -> ets:insert(?HIT_COUNTER_TABLE, {Key, -1}); + {'EXIT', {badarg, _}} -> + true = ets:insert(?HIT_COUNTER_TABLE, {Key, -1}), + ok; _ -> ok end. |