berkeley-container-library / bcl

The Berkeley Container Library
BSD 3-Clause "New" or "Revised" License
120 stars 18 forks source link

Backoff does not back off #6

Closed JiakunYan closed 5 years ago

JiakunYan commented 5 years ago

The method Backoff::backoff() does not increase sleeping time. I think it should invoke increase_backoff_impl_() in its function body.

void backoff() {
  usleep(sleep_time_);
}

void increase_backoff_impl_() {
  sleep_time_ = backoff_fn_(sleep_time_);
  sleep_time_ = std::max(sleep_time_, max_sleep_);
}
BenBrock commented 5 years ago

Feel free to open a pull request to fix this.