Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVIDIA_SESSION_TTL not taking default value 60000 when not supplied in .env #363

Closed
xninjax opened this issue Sep 28, 2020 · 2 comments
Closed
Assignees

Comments

@xninjax
Copy link
Contributor

xninjax commented Sep 28, 2020

https://github.com/jef/nvidia-snatcher/blob/fdcd787f91f26229db23e2291e8922b947007902/src/config.ts#L124

Token is refreshed rapidly when no TTL is supplied in .env - despite the 60000 by default from config.ts - and it appears NVIDIA doesn't like this rapid pinging and eventually beings to fail responding...

NVIDIA_SESSION_TTL=""
Produces the following:

[11:29:42 AM] debug :: ℹ [nvidia] session_token=TOKEN_MASKED
[11:29:42 AM] debug :: ℹ [nvidia] refreshing session token
[11:29:42 AM] debug :: ℹ [nvidia] session_token=TOKEN_MASKED
[11:29:42 AM] debug :: ℹ [nvidia] refreshing session token
[11:29:43 AM] debug :: ℹ [nvidia] session_token=TOKEN_MASKED
[11:29:43 AM] debug :: ℹ [nvidia] refreshing session token
[11:29:43 AM] debug :: ℹ [nvidia] session_token=TOKEN_MASKED
[11:29:43 AM] debug :: ℹ [nvidia] refreshing session token
[11:29:44 AM] debug :: ℹ [nvidia] session_token=TOKEN_MASKED
[11:29:44 AM] debug :: ℹ [nvidia] refreshing session token
[11:29:45 AM] debug :: ℹ [nvidia] session_token=TOKEN_MASKED
[11:29:45 AM] debug :: ℹ [nvidia] refreshing session token
[11:29:45 AM] debug :: ℹ [nvidia] session_token=TOKEN_MASKED
[11:29:45 AM] debug :: ℹ [nvidia] refreshing session token
[11:29:45 AM] debug :: ℹ [nvidia] session_token=TOKEN_MASKED
[11:29:45 AM] debug :: ℹ [nvidia] refreshing session token
[11:29:46 AM] debug :: ℹ [nvidia] session_token=TOKEN_MASKED
[11:29:46 AM] debug :: ℹ [nvidia] refreshing session token

Setting NVIDIA_SESSION_TTL="60000" in .env fixes this.

I haven't looked closely into why envOrNumber() isn't supplying the default when no value is supplied in .env.

@andrewmackrodt
Copy link
Contributor

@jef is there a bug in envOrNumber where an empty environment variable gets interpreted as 0 or is this intended functionality?

@jef
Copy link
Owner

jef commented Sep 28, 2020

@jef is there a bug in envOrNumber where an empty environment variable gets interpreted as 0 or is this intended functionality?

Definitely a bug. Thanks for fixing.

@jef jef closed this as completed Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants