From c88a8d7c978633572f3427ee5c9940184bc4e098 Mon Sep 17 00:00:00 2001 From: Karl Nilsson Date: Fri, 24 May 2024 16:26:57 +0100 Subject: [PATCH] log --- src/ra_log.erl | 2 +- src/ra_log_cache.erl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ra_log.erl b/src/ra_log.erl index 5705557a..d07cf126 100644 --- a/src/ra_log.erl +++ b/src/ra_log.erl @@ -1080,7 +1080,7 @@ truncate_cache(_FromIdx, ToIdx, #?MODULE{cache = Cache} = State, Effects) -> CacheAfter = ra_log_cache:trim(ToIdx, Cache), - ct:pal("cache range after trim ~p", [ra_log_cache:range(CacheAfter)]), + ?DEBUG("cache range after trim ~p", [ra_log_cache:range(CacheAfter)]), {State#?MODULE{cache = CacheAfter}, Effects}. maybe_append_first_entry(State0 = #?MODULE{last_index = -1}) -> diff --git a/src/ra_log_cache.erl b/src/ra_log_cache.erl index bf961fb3..6a924ea4 100644 --- a/src/ra_log_cache.erl +++ b/src/ra_log_cache.erl @@ -43,7 +43,9 @@ init() -> reset(#?MODULE{range = undefined} = State) -> State; reset(#?MODULE{tbl = Tid, + range = Range, cache = _Cache} = State) -> + ?DEBUG("RA LOG CACHE RESET ~p", [Range]), true = ets:delete_all_objects(Tid), State#?MODULE{cache = #{}, range = undefined}.