mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #58051 from ClickHouse/tavplubix-patch-10
Small improvement for SystemLogBase
This commit is contained in:
commit
499984e57a
@ -188,6 +188,9 @@ typename SystemLogQueue<LogElement>::Index SystemLogQueue<LogElement>::pop(std::
|
||||
bool & should_prepare_tables_anyway,
|
||||
bool & exit_this_thread)
|
||||
{
|
||||
/// Call dtors and deallocate strings without holding the global lock
|
||||
output.resize(0);
|
||||
|
||||
std::unique_lock lock(mutex);
|
||||
flush_event.wait_for(lock,
|
||||
std::chrono::milliseconds(settings.flush_interval_milliseconds),
|
||||
@ -200,7 +203,6 @@ typename SystemLogQueue<LogElement>::Index SystemLogQueue<LogElement>::pop(std::
|
||||
queue_front_index += queue.size();
|
||||
// Swap with existing array from previous flush, to save memory
|
||||
// allocations.
|
||||
output.resize(0);
|
||||
queue.swap(output);
|
||||
|
||||
should_prepare_tables_anyway = is_force_prepare_tables;
|
||||
|
Loading…
Reference in New Issue
Block a user