Skip to content

Commit

Permalink
Set AITranslationBean as optional dependency in ThirdPartyTMSSync (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
maallen authored Nov 6, 2024
1 parent cbdf8f1 commit 191ffee
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public ThirdPartyTMSSmartling(
MeterRegistry meterRegistry,
QuartzPollableTaskScheduler quartzPollableTaskScheduler,
AITranslationConfiguration aiTranslationConfiguration,
AITranslationService aiTranslationService) {
@Autowired(required = false) AITranslationService aiTranslationService) {
this(
smartlingClient,
textUnitSearcher,
Expand Down Expand Up @@ -754,6 +754,10 @@ public void pushAITranslations(
String skipAssetsWithPathPattern,
String includeTextUnitsWithPattern,
List<String> optionList) {
if (aiTranslationService == null) {
throw new UnsupportedOperationException(
"AI translation service is not supported as no AITranslationService bean is configured.");
}
try (var timer =
Timer.resource(meterRegistry, "SmartlingSync.pushAITranslations")
.tag("repository", repository.getName())) {
Expand Down

0 comments on commit 191ffee

Please sign in to comment.