콘텐츠 예약 오픈 설정

- 스케줄러 설정 추가
This commit is contained in:
2024-12-02 08:58:54 +09:00
parent e470e70612
commit c1748001d5
4 changed files with 23 additions and 7 deletions

View File

@@ -6,13 +6,13 @@ import org.springframework.stereotype.Component
@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.RUNTIME)
annotation class SchedulerOnly
annotation class AudioContentReleaseSchedulerOnly
@Aspect
@Component
class SchedulerOnlyAspect {
@Before("@annotation(SchedulerOnly)")
@Before("@annotation(AudioContentReleaseSchedulerOnly)")
fun checkSchedulerAccess() {
if (!isSchedulerThread()) {
throw IllegalStateException("잘못된 접근입니다.")
@@ -21,6 +21,6 @@ class SchedulerOnlyAspect {
private fun isSchedulerThread(): Boolean {
// 스케줄러 스레드 여부를 판단하는 간단한 로직
return Thread.currentThread().name.contains("scheduler")
return Thread.currentThread().name.contains("AudioContentRelease-Scheduler")
}
}