Skip to content

Not sure of how backoff_cap works #10

Description

@raff

In the code:

delay_time = self.backoff_cap and min(self.reset_timeout * (2 ** self.test_fail_count), self.backoff_cap) or self.reset_timeout

I am not sure about self.backoff_cap and ...

It look to me that no matter what value you pass for backoff_cap, as long as it's not 0, the value itself is ignored and the expression after "and" determines the actually delay time.

Am I missing something ? Should backoff_cap be the maximum backoff time ? (in which case you probably need to use something like max(backoff_cap, calculated_delay_time)

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions