This commit is contained in:
Antonio Andelic 2023-03-08 13:06:10 +00:00
parent 37b09ce46a
commit b4061d8aa4

View File

@ -211,13 +211,20 @@ public:
void flush()
{
auto * file_buffer = tryGetFileBuffer();
LOG_TRACE(log, "Trying to flush");
if (file_buffer)
{
/// Fsync file system if needed
if (log_file_settings.force_sync)
{
file_buffer->sync();
}
else
{
LOG_TRACE(log, "Flushing with next, in buffer {}", file_buffer->offset());
file_buffer->next();
LOG_TRACE(log, "Flushed in total {}", file_buffer->count());
}
}
}