diff options
| author | levlam <levlam@telegram.org> | 2021-12-07 13:10:30 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2021-12-07 13:10:30 +0300 |
| commit | 42aadccc8b6bec7c0743993a9c46ceec7075388e (patch) | |
| tree | 9de508ee50d8e8db38638ff232c92a82e0a12c47 /tddb | |
| parent | 40e0e3e457aabdb9773a53516f06980dab7b309f (diff) | |
Fix warning.
Diffstat (limited to 'tddb')
| -rw-r--r-- | tddb/td/db/binlog/Binlog.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tddb/td/db/binlog/Binlog.cpp b/tddb/td/db/binlog/Binlog.cpp index 7af598373..7480170cf 100644 --- a/tddb/td/db/binlog/Binlog.cpp +++ b/tddb/td/db/binlog/Binlog.cpp @@ -671,11 +671,11 @@ void Binlog::do_reindex() { auto finish_time = Clocks::monotonic(); auto finish_size = fd_size_; auto finish_events = fd_events_; - for (size_t i = 10; i > 0; i--) { + for (int left_tries = 10; left_tries > 0; left_tries--) { auto r_stat = stat(path_); if (r_stat.is_error()) { - if (i != 1) { - usleep_for(200000 / i); + if (left_tries != 1) { + usleep_for(200000 / left_tries); continue; } LOG(FATAL) << "Failed to rename binlog of size " << fd_size_ << " to " << path_ << ": " << r_stat.error() |
