wakatime / wakatime-mode

Emacs plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/emacs
267 stars 41 forks source link

Customize the ignored exit codes of wakatime-cli #57

Closed SqrtMinusOne closed 2 years ago

SqrtMinusOne commented 2 years ago

I have a problem with the latest wakatime-cli (https://github.com/wakatime/wakatime-cli/issues/509). Emacs lags for half a second whenever error is called from the process sentinel, that is when CLI returns an error. By default, the package ignores 0 & 102 and calls error on any other code.

However, it seems like the CLI returns 1 when offline or when the server load is high, so Emacs basically becomes unusable, as it lags on every CLI call. So I added a variable to customize the ignored exit codes like this:

(setq wakatime-ignore-exit-codes '(0 1 102))
alanhamlett commented 2 years ago

This should be fixed in the latest wakatime-cli. If not, please open a new issue there since wakatime-cli should never exit with 1 when working offline.