rnewson commented on code in PR #5576:
URL: https://github.com/apache/couchdb/pull/5576#discussion_r2161975624
##########
src/couch/src/couch_file.erl:
##########
@@ -596,7 +604,28 @@ handle_call({write_header, Bin}, _From, #file{fd = Fd, eof
= Pos} = File) ->
{reply, Error, reset_eof(File)}
end;
handle_call(find_header, _From, #file{fd = Fd, eof = Pos} = File) ->
- {reply, find_header(Fd, Pos div ?SIZE_BLOCK), File}.
+ {reply, find_header(Fd, Pos div ?SIZE_BLOCK), File};
+handle_call({commit_header, Bin}, From, #file{fd = Fd} = File) ->
+ case fsync(Fd) of
+ ok ->
+ Result = handle_call({write_header, Bin}, From, File),
Review Comment:
I find this quite ugly, can we extract the common code into a function that
both places call please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]