Skip to content

Commit

Permalink
[branch-layout] Run branch layout write in synchronized
Browse files Browse the repository at this point in the history
  • Loading branch information
mkondratek committed Mar 1, 2021
1 parent 1d320fa commit eac5243
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
@RequiredArgsConstructor
public class BranchLayoutFileWriter implements IBranchLayoutWriter {

// TODO (#692): wrap write operation in WriteAction
@Override
public void write(Path path, IBranchLayout branchLayout, boolean backupOldFile) throws BranchLayoutException {
@SuppressWarnings("regexp") // to allow for `synchronized`
public synchronized void write(Path path, IBranchLayout branchLayout, boolean backupOldFile) throws BranchLayoutException {
LOG.debug(() -> "Entering: path = ${path}, branchLayout = ${branchLayout}, backupOldFile = ${backupOldFile}");
val indentSpec = BranchLayoutFileUtils.deriveIndentSpec(path);

Expand Down

0 comments on commit eac5243

Please sign in to comment.