File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
polaris-sync-commons/src/main/java/cn/polarismesh/polaris/sync/common/rest
polaris-sync-registry-core/src/main/java/cn/polarismesh/polaris/sync/registry/tasks Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,6 @@ public static String pickAddress(List<String> addresses) {
4848 return addresses .get (0 );
4949 }
5050 int i = ThreadLocalRandom .current ().nextInt (addresses .size ());
51- if (i >= addresses .size ()) {
52- i = 0 ;
53- }
5451 return addresses .get (i );
5552 }
5653
Original file line number Diff line number Diff line change 2727import com .tencent .polaris .client .pb .ResponseProto .DiscoverResponse ;
2828import com .tencent .polaris .client .pb .ServiceProto .Instance ;
2929import java .io .ByteArrayInputStream ;
30+ import java .io .PrintWriter ;
31+ import java .io .StringWriter ;
3032import java .util .Collection ;
3133import java .util .HashMap ;
3234import java .util .List ;
@@ -87,9 +89,10 @@ public void run() {
8789 }
8890 }
8991 } catch (Throwable e ) {
90- ByteArrayInputStream in = new ByteArrayInputStream ()
91- e .printStackTrace ();
92- LOG .error ("[Core] pull task(source {}) encounter exception {}" , source .getName (), e );
92+ StringWriter sw = new StringWriter ();
93+ PrintWriter pw = new PrintWriter (sw );
94+ e .printStackTrace (pw );
95+ LOG .error ("[Core] pull task(source {}) encounter exception {}" , source .getName (), sw );
9396 }
9497 }
9598
You can’t perform that action at this time.
0 commit comments