Skip to content

Commit

Permalink
Merge pull request #146 from chjcode/feat/diary
Browse files Browse the repository at this point in the history
Random -> ThreadLocalRandom 으로 수정
  • Loading branch information
chjcode authored Aug 10, 2024
2 parents dbc586f + cf6ab35 commit 6e1fbfc
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.List;
import java.util.Random;

import java.util.concurrent.ThreadLocalRandom;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
Expand Down Expand Up @@ -213,9 +214,7 @@ private void updateTags(Diary diary, List<String> newHashtags) {
}

private int makeRewardPoint() {
long seed = System.currentTimeMillis();
Random random = new Random(seed);
return 50 + (random.nextInt(6) * 10);
return 50 + (ThreadLocalRandom.current().nextInt(6) * 10);
}

private void saveRewardPointAndHistory(Member member, int rewardPoint) {
Expand Down

0 comments on commit 6e1fbfc

Please sign in to comment.