mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Don't update "arrow" on client-side for nothing
This commit is contained in:
parent
8c640f54f8
commit
92769a2460
2
.gitignore
vendored
2
.gitignore
vendored
@ -243,3 +243,5 @@ website/package-lock.json
|
||||
|
||||
# ccls cache
|
||||
/.ccls-cache
|
||||
|
||||
/compile_commands.json
|
||||
|
@ -1031,7 +1031,8 @@ private:
|
||||
|
||||
// TODO: get the poll_interval from commandline.
|
||||
const auto receive_timeout = connection->getTimeouts().receive_timeout;
|
||||
constexpr size_t default_poll_interval = 1000000, min_poll_interval = 5000; /// in microseconds
|
||||
constexpr size_t default_poll_interval = 1000000; /// in microseconds
|
||||
constexpr size_t min_poll_interval = 5000; /// in microseconds
|
||||
const size_t poll_interval
|
||||
= std::max(min_poll_interval, std::min<size_t>(receive_timeout.totalMicroseconds(), default_poll_interval));
|
||||
|
||||
@ -1333,7 +1334,11 @@ private:
|
||||
|
||||
void onProgress(const Progress & value)
|
||||
{
|
||||
progress.incrementPiecewiseAtomically(value);
|
||||
if (!progress.incrementPiecewiseAtomically(value))
|
||||
{
|
||||
// Just a keep-alive update.
|
||||
return;
|
||||
}
|
||||
if (block_out_stream)
|
||||
block_out_stream->onProgress(value);
|
||||
writeProgress();
|
||||
|
@ -53,11 +53,16 @@ struct Progress
|
||||
void writeJSON(WriteBuffer & out) const;
|
||||
|
||||
/// Each value separately is changed atomically (but not whole object).
|
||||
void incrementPiecewiseAtomically(const Progress & rhs)
|
||||
bool incrementPiecewiseAtomically(const Progress & rhs)
|
||||
{
|
||||
if (!rhs.rows)
|
||||
return false;
|
||||
|
||||
rows += rhs.rows;
|
||||
bytes += rhs.bytes;
|
||||
total_rows += rhs.total_rows;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void reset()
|
||||
|
Loading…
Reference in New Issue
Block a user