Skip to content

Commit

Permalink
refactor: log 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
tco0427 committed Aug 4, 2022
1 parent 604e9b4 commit 46608ec
Showing 1 changed file with 3 additions and 6 deletions.
@@ -1,21 +1,18 @@
package com.woowacourse.moamoa.study.schedule;

import com.woowacourse.moamoa.MoamoaApplication;
import com.woowacourse.moamoa.study.service.StudyService;
import java.time.LocalDateTime;
import java.time.ZoneId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.config.TriggerTask;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Component
@Slf4j
public class AutoCloseEnrollmentTask extends TriggerTask {

private static final Logger LOGGER = LoggerFactory.getLogger(MoamoaApplication.class);

public AutoCloseEnrollmentTask(final StudyService studyService) {
super(runnable(studyService), new CronTrigger("@daily", ZoneId.of("Asia/Seoul")));
}
Expand All @@ -25,7 +22,7 @@ private static Runnable runnable(final StudyService studyService) {

@Transactional
public void run() {
LOGGER.debug(LocalDateTime.now() + " : " + "start moamoa scheduled task!");
log.debug("{} : start moamoa scheduled task!", LocalDateTime.now());
studyService.autoUpdateStatus();
}
};
Expand Down

0 comments on commit 46608ec

Please sign in to comment.