diff --git a/voussoirkit/backoff.py b/voussoirkit/backoff.py index 124c49d..461710f 100644 --- a/voussoirkit/backoff.py +++ b/voussoirkit/backoff.py @@ -24,10 +24,14 @@ class Backoff: raise ValueError(f'max must be positive, not {max}.') self.max = max - def next(self): + def current(self): y = self._calc() if self.max is not None: y = min(y, self.max) + return y + + def next(self): + y = self.current() self.x += 1 return y