Open timotheecour opened 4 years ago
Probably updating analytics.nim#newAnalyticsRef:43 with default timeout
when T is HttpClient: newHttpClient(userAgent = ua, proxy = proxy, timeout = connectionTimeoutMs)
else: newAsyncHttpClient(userAgent = ua, proxy = proxy, timeout = connectionTimeoutMs),
could've helped. But currently Nim's sync http client supports timeout parameter, while async client does not (there is a todo there, httpclient.nim#newAsyncHttpClient).
Seems like choosenim generally relies on async analytics, which uses async http client, so above mentioned patch won't help :)
Maybe this little comment will help someone in future to fix the issue
choosenim dir
stuck forever in analytics when network connection dropsI reproduced this a few times. There should be some kind of timeout to avoid this (IIRC there was a 5s timeout in place, but doesnt' seem to work, I interrupted after 20 seconds by ^C)
choosenim -v choosenim v0.5.0 (2020-01-14 23:56:52) [macosx/amd64]
workaround
create a hotspot using your phone, connect internet to that, then it works; note that if i stop my network connection after that and rerun
choosenim $dir
, no more hang, but I presume it's because analytics were already collected in some recent time