Skip to content

Commit 6be0d58

Browse files
committed
use segment.run instead of setTraceEntity
1 parent 860550c commit 6be0d58

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/scorekeep/MoveFactory.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ public Move newMove(String sessionId, String gameId, String userId, String moveT
7070
Entity segment = recorder.getTraceEntity();
7171
Thread comm = new Thread() {
7272
public void run() {
73-
recorder.setTraceEntity(segment);
74-
Subsegment subsegment = AWSXRay.beginSubsegment("## Send notification");
75-
Sns.sendNotification("Scorekeep game completed", "Winner: " + userId);
76-
AWSXRay.endSubsegment();
73+
segment.run(() -> {
74+
Subsegment subsegment = AWSXRay.beginSubsegment("## Send notification");
75+
Sns.sendNotification("Scorekeep game completed", "Winner: " + userId);
76+
AWSXRay.endSubsegment();
77+
});
7778
}
7879
};
7980
comm.start();

0 commit comments

Comments
 (0)