Ver a proveniência
Remove TODO and add a second file:close due to delayed write
pull/509/head
Luke Bakken
há 5 anos
ascendente
cometimento
4ed9b558ac
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados
ID da chave GPG: D99DE30E43EAE440
2 ficheiros alterados com
1 adições e
1 eliminações
-
src/lager_file_backend.erl
-
src/lager_rotator_default.erl
|
|
@ -472,7 +472,6 @@ close_file(#state{fd=undefined} = State) -> |
|
|
|
State; |
|
|
|
close_file(#state{fd=FD} = State) -> |
|
|
|
%% Flush and close any file handles. |
|
|
|
%% TODO LRB don't match, but report errors??? |
|
|
|
_ = file:datasync(FD), |
|
|
|
%% delayed write can cause file:close not to do a close |
|
|
|
_ = file:close(FD), |
|
|
|
|
|
@ -67,6 +67,7 @@ rotate_logfile(File, 0) -> |
|
|
|
%% open the file in write-only mode to truncate/create it |
|
|
|
case file:open(File, [write]) of |
|
|
|
{ok, FD} -> |
|
|
|
_ = file:close(FD), |
|
|
|
_ = file:close(FD), |
|
|
|
{ok, _Ctime} = maybe_update_ctime(File), |
|
|
|
ok; |
|
|
|