Skip to content

Commit

Permalink
fix : fly.io 성능 이슈로 InitData 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kyumho kim committed Feb 2, 2024
1 parent ac8087b commit e2c525b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Binary file modified db_prod.mv.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
import lombok.RequiredArgsConstructor;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.Profile;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class NotProd implements ApplicationRunner {
public class InitData implements ApplicationRunner {

private final PostRepository postRepository;
private final UserRepository userRepository;
Expand All @@ -26,7 +25,7 @@ public class NotProd implements ApplicationRunner {
public void run(ApplicationArguments args) throws Exception {
if (userRepository.count() == 0) {

IntStream.rangeClosed(1, 50).forEach(i -> {
IntStream.rangeClosed(1, 25).forEach(i -> {
User testUser = User
.builder()
.username("test" + i)
Expand All @@ -53,7 +52,7 @@ public void run(ApplicationArguments args) throws Exception {

postRepository.save(post);
});
IntStream.rangeClosed(51, 100).forEach(i -> {
IntStream.rangeClosed(26, 50).forEach(i -> {
User testUser = User
.builder()
.username("test" + i)
Expand Down

0 comments on commit e2c525b

Please sign in to comment.