wakatime / jetbrains-wakatime

IntelliJ IDEA, PyCharm, RubyMine, PhpStorm, AppCode, AndroidStudio, Goland, Rider, & WebStorm plugin for quantifying your coding.
https://wakatime.com/intellij-idea
BSD 3-Clause "New" or "Revised" License
1.12k stars 163 forks source link

Backoff delay broken #210

Closed sanasol closed 2 years ago

sanasol commented 2 years ago

Somehow got many errors, so plugin started "backoff algorithm" But delay time calculation based on tries counter is went crazy. So I have to reset it manually to make it work without waiting until June 🤣

{"caller":"pkg/backoff/backoff.go:40","func":"backoff.WithBackoff","level":"debug","message":"execute heartbeat backoff algorithm","now":"2022-05-13T21:24:57+03:00","version":"v1.45.2"} {"caller":"pkg/backoff/backoff.go:78","func":"backoff.shouldBackoff","level":"debug","message":"exponential backoff tried 16 times since May 13 20:32:37, will retry at May 25 05:36:37","now":"2022-05-13T21:24:57+03:00","version":"v1.45.2"}

{"caller":"pkg/backoff/backoff.go:40","func":"backoff.WithBackoff","level":"debug","message":"execute heartbeat backoff algorithm","now":"2022-05-13T22:18:06+03:00","version":"v1.45.2"} {"caller":"pkg/backoff/backoff.go:78","func":"backoff.shouldBackoff","level":"debug","message":"exponential backoff tried 17 times since May 13 21:32:58, will retry at Jun 5 15:40:58","now":"2022-05-13T22:18:06+03:00","version":"v1.45.2"}

sanasol commented 2 years ago

probably should not be so much exponential 😄

gandarez commented 2 years ago

Backoff never gets longer than 1h but it incorrectly logs the next tick. I fixed it in this PR which is pending for review.

alanhamlett commented 2 years ago

Restart your IDE to get the fix.