mise icon indicating copy to clipboard operation
mise copied to clipboard

rtx ls takes 10 seconds

Open dfang opened this issue 2 years ago • 10 comments

ubuntu@ubuntu2204:~/ $ time rtx ls --verbose
[WARN] rtx::config: newer rtx version 1.34.0 available, currently on 1.32.5
[WARN] rtx::toolset::tool_version_list: failed to resolve tool version: timed out updating node-build: timed out waiting on channel
erlang 26.0.2 
node   20.0.0 
nodejs 16.14.0
nodejs 18.16.0 ~/.tool-versions 18.16.0
nodejs 20.0.0 
pdm    2.7.4  
python 3.10.12

real	0m10.071s
user	0m0.035s
sys	0m0.104s

$ cat ~/.tool-versions 
nodejs 18.16.0

fyi: without global config file ~/.config/rtx/config.toml

dfang avatar Jul 14 '23 02:07 dfang

after I add these lines:

$ cat ~/.config/rtx/config.toml
[settings]
plugin_autoupdate_last_check_duration = '1 week' # set to 0 to disable updates


$ time rtx ls
[WARN] rtx::config: newer rtx version 1.34.0 available, currently on 1.32.5
erlang 26.0.2         
node   16.14.0 (missing) ~/.rtx.toml    16.14.0
node   20.0.0         
nodejs 16.14.0        
nodejs 18.16.0         ~/.tool-versions 18.16.0
nodejs 20.0.0         
pdm    2.7.4          
python 3.10.12        

real	0m0.077s
user	0m0.039s
sys	0m0.071s

Is there any environment variables like RTX_UPDATE_CHECK, RTX_PLUGINS_UPDATE_CHECK ?

dfang avatar Jul 14 '23 02:07 dfang

it's timing out checking for new node versions. You can customize this with RTX_FETCH_REMOTE_VERSIONS_TIMEOUT=10s.

jdx avatar Jul 14 '23 17:07 jdx

thanks. but this is not what I mean.

for the best performance, I don't want auto check for rtx itself, rtx-plugins, rtx-apps(node,go that installed by rtx plugin), especially when I run rtx ls. I think only checking for new versions when rtx ls-remote xxx or rtx outdated is reasonable. and if I want to update, I will run rtx self-update and rtx plugin update for myself.

so it would be great if there are some default environment like RTX_UPDATE_CHECK, RTX_PLUGINS_UPDATE_CHECK, RTX_APPS_UPDATE_CHECK with default value 0.

what do you think?

dfang avatar Jul 14 '23 22:07 dfang

there are no such checks

jdx avatar Jul 14 '23 23:07 jdx

close ?

dfang avatar Jul 15 '23 00:07 dfang

it's timing out checking for new node versions. You can customize this with RTX_FETCH_REMOTE_VERSIONS_TIMEOUT=10s.

I don't understand why check new node versions when rtx ls, however I've upgraded rtx, I can't reproduce this issue.

dfang avatar Jul 15 '23 00:07 dfang

there are no such checks

hi @jdxcode if there are no checks why gnutls_handshake() failed when I run rtx install [email protected]

Screen Shot 2023-07-18 at 9 40 41 AM

dfang avatar Jul 18 '23 01:07 dfang

When you install something it checks for new versions

jdx avatar Jul 18 '23 02:07 jdx

I don't think it's necessary, at least I don't want this feature, and it may fail because of network issue. is there a way to disable this feature currently?

dfang avatar Jul 19 '23 14:07 dfang

Automatic checks for updates might be convenient, but are definitely not something that should block the user's workflow. And when a shell takes 10 seconds just to launch in case of a poor internet connection, it does block the workflow. So there definitely should be an option to disable the checks at least for rtx ls or shell hooks, i.e. operations that do not need the internet connection. Obviously, rtx install or rtx ls-remote are useless without the internet connection, so such an option should be ignored in these commands.

ineu avatar Aug 10 '23 09:08 ineu

I have not heard of any new reports about this so I assume it's resolved

jdx avatar Feb 22 '24 01:02 jdx