File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed
core/src/main/java/com/taobao/arthas/core/util Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -139,14 +139,29 @@ public static String welcome(Map<String, String> infos) {
139139 }
140140
141141 static String latestVersion () {
142+ final String [] version = { "" };
143+ Thread thread = new Thread (new Runnable () {
144+ @ Override
145+ public void run () {
146+ try {
147+ URLConnection urlConnection = openURLConnection (ARTHAS_LATEST_VERSIONS_URL );
148+ InputStream inputStream = urlConnection .getInputStream ();
149+ version [0 ] = com .taobao .arthas .common .IOUtils .toString (inputStream ).trim ();
150+ } catch (Throwable e ) {
151+ logger .debug ("get latest version error" , e );
152+ }
153+ }
154+ });
155+
156+ thread .setDaemon (true );
157+ thread .start ();
142158 try {
143- URLConnection urlConnection = openURLConnection (ARTHAS_LATEST_VERSIONS_URL );
144- InputStream inputStream = urlConnection .getInputStream ();
145- return com .taobao .arthas .common .IOUtils .toString (inputStream ).trim ();
159+ thread .join (2000 ); // Wait up to 2 seconds for the version check
146160 } catch (Throwable e ) {
147- // ignore
161+ // Ignore
148162 }
149- return "" ;
163+
164+ return version [0 ];
150165 }
151166
152167 /**
You can’t perform that action at this time.
0 commit comments