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())
{
// 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)
auto next_it =
std::min_element(begin(parts_queue), end(parts_queue),
[](const auto &l, const auto &r) {
return l.time < r.time;
});
if (next_it != parts_queue.end()) {
// 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)
auto next_it = std::min_element(
begin(parts_queue), end(parts_queue), [](const auto & l, const auto & r) { return l.time < r.time; });
if (next_it != parts_queue.end())
{
auto delay = next_it->time - current_time;
task->scheduleAfter(delay * 1000);
}

View File

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