From dd1e534f24b1b3d56a364cbd301c9cb4b8f5031e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=88=EB=A6=BC?= Date: Mon, 9 Mar 2026 18:32:09 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20website=20=EB=8F=99=EC=8B=9C=20=EC=82=BD?= =?UTF-8?q?=EC=9E=85=20=EC=98=88=EC=99=B8=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../retoday/core/domain/history/service/WebsiteService.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/kotlin/com/retoday/core/domain/history/service/WebsiteService.kt b/core/src/main/kotlin/com/retoday/core/domain/history/service/WebsiteService.kt index 908eebef..185d60bf 100644 --- a/core/src/main/kotlin/com/retoday/core/domain/history/service/WebsiteService.kt +++ b/core/src/main/kotlin/com/retoday/core/domain/history/service/WebsiteService.kt @@ -26,9 +26,10 @@ class WebsiteService( } } ?: try { websiteRepository - .save(Website(domain = domain, faviconUrl = faviconUrl)) + .saveAndFlush(Website(domain = domain, faviconUrl = faviconUrl)) .also { eventPublisher.publishEvent(WebsiteCategoryClassificationEvent(it.id!!, domain)) } } catch (e: DataIntegrityViolationException) { - websiteRepository.findByDomain(domain)!! + websiteRepository.findByDomain(domain) + ?: throw IllegalStateException("Website not found after duplicate key violation: $domain") } }