fix(osiv): lazy 관계 선로딩을 보완한다
This commit is contained in:
@@ -2,12 +2,14 @@ package kr.co.vividnext.sodalive.i18n.translation
|
||||
|
||||
import kr.co.vividnext.sodalive.i18n.translation.PapagoTranslationService.Companion.getTranslatableLanguageCodes
|
||||
import org.springframework.stereotype.Service
|
||||
import org.springframework.transaction.annotation.Transactional
|
||||
|
||||
@Service
|
||||
class ResourceTranslationJobScheduler(
|
||||
private val sourceExtractor: TranslationSourceExtractor,
|
||||
private val translationJobScheduler: TranslationJobScheduler
|
||||
) {
|
||||
@Transactional
|
||||
fun scheduleResourceTranslations(resourceType: LanguageTranslationTargetType, resourceId: Long) {
|
||||
val source = sourceExtractor.extract(resourceType, resourceId) ?: return
|
||||
getTranslatableLanguageCodes(source.sourceLanguage).forEach { targetLanguage ->
|
||||
@@ -15,6 +17,7 @@ class ResourceTranslationJobScheduler(
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
fun scheduleResourceTranslation(
|
||||
resourceType: LanguageTranslationTargetType,
|
||||
resourceId: Long,
|
||||
|
||||
Reference in New Issue
Block a user