Skip to content

Commit 7f2bc74

Browse files
hsun324facebook-github-bot
authored andcommitted
Remove legacy name for the database path
Summary: Remove the legacy `db` name for the database path. This allows for specifying the database path under `raft_database` under `wa_raft` similarly to how it should be specified per-application. Differential Revision: D78370203 fbshipit-source-id: 9280b1d0dcda583063a80bac2c44225d612a1113
1 parent 1fd869e commit 7f2bc74

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/wa_raft.hrl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
%% Registered information about applications and partitions
1212
%%-------------------------------------------------------------------
1313

14+
%% Name of the application environment key that is expected to contain a path
15+
%% to the directory in which RAFT should place the partition paths for the
16+
%% RAFT partitions under a RAFT client application. This environment value uses
17+
%% the application search order to determine the value to use.
18+
-define(RAFT_DATABASE, raft_database).
1419
%% Default location containing databases for RAFT partitions part of a RAFT client application
1520
-define(RAFT_DATABASE_PATH(Application), (wa_raft_env:database_path(Application))).
1621
%% Registered database location for the specified RAFT partition

src/wa_raft_env.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
-spec database_path(Scope :: scope()) -> Root :: file:filename().
3434
database_path(Scope) ->
35-
case get_env(Scope, {raft_database, db}) of
35+
case get_env(Scope, ?RAFT_DATABASE) of
3636
{ok, Root} -> Root;
3737
undefined -> error({no_configured_database_path, Scope})
3838
end.

0 commit comments

Comments
 (0)