Fix style

This commit is contained in:
Igor Nikonov 2023-10-30 16:35:00 +00:00
parent f2acc366f7
commit 0958d0b168
2 changed files with 11 additions and 11 deletions

View File

@ -559,14 +559,13 @@ void ReplicatedMergeTreePartCheckThread::run()
}); });
if (selected == parts_queue.end()) if (selected == parts_queue.end())
{ {
// find next part to check in the queue and schedule the check // Find next part to check in the queue and schedule the check
// otherwise, scheduled for later checks won't be executed until a new check is enqueued (i.e. task is scheduled again) // Otherwise, scheduled for later checks won't be executed until
auto next_it = // a new check is enqueued (i.e. task is scheduled again)
std::min_element(begin(parts_queue), end(parts_queue), auto next_it = std::min_element(
[](const auto &l, const auto &r) { begin(parts_queue), end(parts_queue), [](const auto & l, const auto & r) { return l.time < r.time; });
return l.time < r.time; if (next_it != parts_queue.end())
}); {
if (next_it != parts_queue.end()) {
auto delay = next_it->time - current_time; auto delay = next_it->time - current_time;
task->scheduleAfter(delay * 1000); task->scheduleAfter(delay * 1000);
} }

View File

@ -90,7 +90,8 @@ private:
Poco::Logger * log; Poco::Logger * log;
using StringSet = std::set<String>; using StringSet = std::set<String>;
struct PartToCheck { struct PartToCheck
{
String name; String name;
time_t time; time_t time;
}; };