From 690aed6f5fbd10cb6243224f96f9645b64943c67 Mon Sep 17 00:00:00 2001 From: Wilson Li Date: Thu, 26 Oct 2017 10:43:50 +0900 Subject: [PATCH 1/2] Added is_disc_cache_active/0 --- src/leo_cache_api.erl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/leo_cache_api.erl b/src/leo_cache_api.erl index 7023f99..df6547a 100644 --- a/src/leo_cache_api.erl +++ b/src/leo_cache_api.erl @@ -37,7 +37,7 @@ -export([start/0, start/1, stop/0, get_filepath/1, get_ref/1, get/1, get/2, put/2, put/3, put_begin_tran/2, put_end_tran/5, - delete/1, stats/0]). + delete/1, stats/0, is_disc_cache_active/0]). %%----------------------------------------------------------------------- %% External API @@ -361,3 +361,15 @@ stats() -> {ok, #stats{}} end. + +%% @doc Return if Disk Cache is active +%% +-spec(is_disc_cache_active() -> + boolean()). +is_disc_cache_active() -> + case ets:lookup(?ETS_CACHE_SERVER_INFO, 0) of + [{_, Item}|_] -> + Item#cache_server.disc_cache_active; + _ -> + false + end. From c99bcb69b359027dc3b5c40c464350d05fa6a3f8 Mon Sep 17 00:00:00 2001 From: Wilson Li Date: Thu, 26 Oct 2017 11:18:03 +0900 Subject: [PATCH 2/2] Added .travis.yml --- .travis.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fd853cf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +# +# Leo Cache +# +language: erlang +script: "make && make eunit" +notifications: + email: false +otp_release: + - 18.3 + - 19.3 + - 20.0 +before_install: + - sudo apt-get update -qq + - sudo apt-get install -y check