Skip to content

Commit

Permalink
fix: prod 실행 옵션 dev와 동일하게 수정 및 Board entity 코드 복구
Browse files Browse the repository at this point in the history
  • Loading branch information
eesum committed Apr 30, 2024
1 parent 2f81843 commit 4d4acde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .ebextensions/build-prod.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ files:

# run app
killall java
java -Dspring.profiles.active=prod -Dfile.encoding=UTF-8 -jar $JAR_PATH
java -Dspring.profiles.active=prod -Dfile.encoding=UTF-8 -Duser.timezone=Asia/Seoul -jar $JAR_PATH
6 changes: 2 additions & 4 deletions src/main/java/com/strcat/domain/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
Expand Down Expand Up @@ -76,14 +75,13 @@ public Long calculateTotalContentLength() {
}

public LocalDateTime findLastContentCreatedTime() {

if (!contents.isEmpty()) {
return contents.stream()
.map(content -> content.getCreatedAt().atZone(ZoneId.of("Asia/Seoul")).toLocalDateTime())
.map(Content::getCreatedAt)
.max(LocalDateTime::compareTo)
.orElse(null);
} else {
return createdAt.atZone(ZoneId.of("Asia/Seoul")).toLocalDateTime();
return createdAt;
}
}

Expand Down

0 comments on commit 4d4acde

Please sign in to comment.