-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
130 additions
and
26 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
Api/src/main/java/allchive/server/api/common/aop/TestTimerAop.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package allchive.server.api.common.aop; | ||
|
||
|
||
import allchive.server.core.helper.SpringEnvironmentHelper; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.aspectj.lang.ProceedingJoinPoint; | ||
import org.aspectj.lang.annotation.Around; | ||
import org.aspectj.lang.annotation.Aspect; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.util.StopWatch; | ||
|
||
@Aspect | ||
@Component | ||
@Slf4j | ||
@RequiredArgsConstructor | ||
public class TestTimerAop { | ||
private final SpringEnvironmentHelper springEnvironmentHelper; | ||
|
||
@Around("@annotation(org.springframework.transaction.annotation.Transactional)") | ||
public Object handleEvent(ProceedingJoinPoint joinPoint) throws Throwable { | ||
if (!springEnvironmentHelper.isProdAndDevProfile()) { | ||
StopWatch stopWatch = new StopWatch(); | ||
stopWatch.start(); | ||
|
||
Object result = joinPoint.proceed(); | ||
|
||
stopWatch.stop(); | ||
log.info(String.valueOf(stopWatch.getLastTaskTimeMillis())); | ||
return result; | ||
} else { | ||
return joinPoint.proceed(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...in/java/allchive/server/domain/domains/archiving/service/ArchivingAsyncDomainService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package allchive.server.domain.domains.archiving.service; | ||
|
||
|
||
import allchive.server.core.annotation.DomainService; | ||
import allchive.server.domain.domains.content.domain.enums.ContentType; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.scheduling.annotation.Async; | ||
|
||
@DomainService | ||
@RequiredArgsConstructor | ||
public class ArchivingAsyncDomainService { | ||
private final ArchivingDomainService archivingDomainService; | ||
|
||
@Async(value = "archivingContentCntTaskExecutor") | ||
public void updateContentCnt(Long archivingId, ContentType contentType, int i) { | ||
archivingDomainService.updateContentCnt(archivingId, contentType, i); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...n/src/main/java/allchive/server/domain/domains/content/service/TagAsyncDomainService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package allchive.server.domain.domains.content.service; | ||
|
||
|
||
import allchive.server.core.annotation.DomainService; | ||
import allchive.server.domain.domains.content.domain.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.scheduling.annotation.Async; | ||
|
||
@DomainService | ||
@RequiredArgsConstructor | ||
public class TagAsyncDomainService { | ||
private final TagDomainService tagDomainService; | ||
|
||
@Async(value = "tagTaskExecutor") | ||
public void updateUsedAt(Tag tag) { | ||
tagDomainService.updateUsedAt(tag); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters