More fixes

This commit is contained in:
Amesaru 2021-04-16 20:16:29 +03:00 committed by Amesaru
parent f4f6e17bcd
commit 35215b24cf
3 changed files with 5 additions and 10 deletions

View File

@ -20,7 +20,6 @@
#include <Common/ThreadStatus.h> #include <Common/ThreadStatus.h>
#include <Common/UnicodeBar.h> #include <Common/UnicodeBar.h>
#include <Common/config_version.h> #include <Common/config_version.h>
#include <Common/escapeForFileName.h>
#include <Common/quoteString.h> #include <Common/quoteString.h>
#include <IO/ReadBufferFromFile.h> #include <IO/ReadBufferFromFile.h>
#include <IO/ReadBufferFromString.h> #include <IO/ReadBufferFromString.h>
@ -393,7 +392,7 @@ void LocalServer::processQueries()
///Set progress show ///Set progress show
progress_bar.setNeedRenderProgress(config().getBool("progress", false)); progress_bar.setNeedRenderProgress(config().getBool("progress", false));
context.setProgressCallback([&](const Progress &value){ context->setProgressCallback([&](const Progress &value){
progress_bar.updateProgress(progress, value); progress_bar.updateProgress(progress, value);
progress_bar.writeProgress(progress, watch); progress_bar.writeProgress(progress, watch);
return true; return true;

View File

@ -4,10 +4,6 @@
#include <Common/UnicodeBar.h> #include <Common/UnicodeBar.h>
#include <Databases/DatabaseMemory.h> #include <Databases/DatabaseMemory.h>
namespace DB { namespace DB {
bool ProgressBar::getNeedRenderProgress() const bool ProgressBar::getNeedRenderProgress() const
{ {
@ -49,12 +45,12 @@ void ProgressBar::setWrittenFirstBlock(bool writtenFirstBlock)
written_first_block = writtenFirstBlock; written_first_block = writtenFirstBlock;
} }
bool ProgressBar::updateProgress(Progress & progress, const Progress &value) bool ProgressBar::updateProgress(Progress &progress, const Progress &value)
{ {
return progress.incrementPiecewiseAtomically(value); return progress.incrementPiecewiseAtomically(value);
} }
void ProgressBar::writeProgress(const Progress & progress, const Stopwatch & watch) { void ProgressBar::writeProgress(const Progress &progress, const Stopwatch &watch) {
if (!need_render_progress) if (!need_render_progress)
return; return;

View File

@ -13,8 +13,8 @@ class ProgressBar
{ {
public: public:
bool updateProgress(Progress & progress, const Progress &value); bool updateProgress(Progress &progress, const Progress &value);
void writeProgress(const Progress & progress, const Stopwatch & watch); void writeProgress(const Progress &progress, const Stopwatch &watch);
///Required Getters ///Required Getters
bool getNeedRenderProgress() const; bool getNeedRenderProgress() const;