Skip to content

Commit

Permalink
rabbit_khepri: Remove serial file during reset
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbbell committed Nov 15, 2024
1 parent e41d766 commit 05717cc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions deps/rabbit/src/rabbit_khepri.erl
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,10 @@ reset() ->
%% Restart it.
ok = setup(),
ok = khepri_cluster:reset(?RA_CLUSTER_NAME),
ok = khepri:stop(?RA_CLUSTER_NAME);
ok = khepri:stop(?RA_CLUSTER_NAME),

_ = file:delete(rabbit_guid:filename()),
ok;
true ->
throw({error, rabbitmq_unexpectedly_running})
end.
Expand All @@ -605,7 +608,10 @@ force_reset() ->
DataDir = maps:get(data_dir, ra_system:fetch(coordination)),
ok = ra_system:ensure_ra_system_stopped(coordination),
ok = rabbit_file:recursive_delete(
filelib:wildcard(DataDir ++ "/*"));
filelib:wildcard(DataDir ++ "/*")),

_ = file:delete(rabbit_guid:filename()),
ok;
true ->
throw({error, rabbitmq_unexpectedly_running})
end.
Expand Down

0 comments on commit 05717cc

Please sign in to comment.