콘텐츠 예약 오픈 설정
- 스케줄러 설정 추가
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user