Skip to content

Commit

Permalink
Merge pull request #207 from Kernel360/develop
Browse files Browse the repository at this point in the history
배포
  • Loading branch information
km2535 authored Aug 29, 2024
2 parents ff05e04 + f798969 commit b5a1a9b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ jobs:
sudo docker pull ${{ secrets.DOCKERHUB_CONTAINERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:latest
# Stop and remove the existing container if it exists
sudo docker ps -q -f name=speech2 | xargs -r sudo docker stop
sudo docker ps -q -f name=speechup-spring | xargs -r sudo docker stop
sudo docker images --filter "dangling=true" -q | xargs sudo docker rmi
sudo docker ps -a -q -f name=speech2 | xargs -r sudo docker rm
sudo docker ps -a -q -f name=speechup-spring | xargs -r sudo docker rm
# Run the new container with environment variables
sudo docker run -d \
-p 8080:8080 \
--name speech2 \
--name speechup-spring -v /root/logs/:/root/logs/ \
${{ secrets.DOCKERHUB_CONTAINERNAME }}/${{ secrets.DOCKERHUB_REPOSITORY }}:latest
# Clean up old Docker images on the server
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/speech/up/admin/dto/StatisticsAdd.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ public class StatisticsAdd {
@Builder
@ToString
public static class Request{
private final Long id;
private final Long report;
private final Long script;
private final Long record;
private final double score;
private final LocalDateTime createAt;

private Request(Long id, Long report, Long script, Long record, double score, LocalDateTime createAt) {
this.id = id;
private Request(Long report, Long script, Long record, double score, LocalDateTime createAt) {
this.report = report;
this.script = script;
this.record = record;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class StatisticsEntity {
private LocalDateTime createAt;

public StatisticsEntity(StatisticsAdd.Request statisticsAdd) {
this.id = statisticsAdd.getId();
this.report = statisticsAdd.getReport();
this.script = statisticsAdd.getScript();
this.record = statisticsAdd.getRecord();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.speech.up.report.repository.ReportRepository;
import com.speech.up.script.repository.ScriptRepository;

import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;

@Service
Expand All @@ -27,7 +28,8 @@ public class StatisticsScheduling {
private final StatisticsRepository statisticsRepository;


@Scheduled(cron = "0 0 0 * * ?") // 매일 자정에 실행
@Scheduled(cron = "0 0 1 * * *")
@Transactional
public void runStatisticsSetter() {
statisticsSetter();
}
Expand All @@ -45,8 +47,9 @@ void statisticsSetter(){
.score(getAvgScore())
.createAt(LocalDateTime.now())
.build();
StatisticsEntity statisticsEntity = StatisticsEntity.create(request);

statisticsRepository.save(StatisticsEntity.create(request));
statisticsRepository.save(statisticsEntity);
}

double getAvgScore(){
Expand Down

0 comments on commit b5a1a9b

Please sign in to comment.