Skip to content

Commit

Permalink
dets:sync/1 only in deinit stage
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovanni Visciano committed May 20, 2024
1 parent 5fafc73 commit e460557
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/ra_directory.erl
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ register_name(#{directory := Directory,
ClusterName}),
case uid_of(System, ServerName) of
undefined ->
ok = dets:insert(DirRev, {ServerName, UId}),
ok = dets:sync(DirRev);
ok = dets:insert(DirRev, {ServerName, UId});
UId ->
%% no need to insert into dets table if already there
ok;
OtherUId ->
ok = dets:insert(DirRev, {ServerName, UId}),
ok = dets:sync(DirRev),
?WARN("ra server with name ~ts UId ~s replaces prior UId ~s",
[ServerName, UId, OtherUId]),
ok
Expand All @@ -98,7 +96,6 @@ unregister_name(#{directory := Directory,
case ets:take(Directory, UId) of
[{_, _, _, ServerName, _}] ->
ok = dets:delete(DirRev, ServerName),
ok = dets:sync(DirRev),
UId;
[] ->
UId
Expand Down

0 comments on commit e460557

Please sign in to comment.