@@ -8,6 +8,7 @@ import org.gitanimals.render.domain.UserService
88import org.gitanimals.render.domain.event.NewUserCreated
99import org.gitanimals.render.domain.event.Visited
1010import org.rooftop.netx.api.SagaManager
11+ import org.slf4j.LoggerFactory
1112import org.slf4j.MDC
1213import org.springframework.context.ApplicationEventPublisher
1314import org.springframework.stereotype.Service
@@ -22,6 +23,8 @@ class AnimationFacade(
2223 private val githubOpenApi : GithubOpenApi ,
2324) {
2425
26+ private val logger = LoggerFactory .getLogger(this ::class .simpleName)
27+
2528 fun getFarmAnimation (username : String ): String {
2629 return when (userService.existsByName(username)) {
2730 true -> {
@@ -59,15 +62,19 @@ class AnimationFacade(
5962 }
6063
6164 private fun setUserAuthInfoIfNotSet (username : String ) {
62- val user = userService.getUserByName(username)
65+ runCatching {
66+ val user = userService.getUserByName(username)
6367
64- if (user.isAuthInfoSet().not ()) {
65- val githubUserAuthInfo = githubOpenApi.getGithubUser(user.getName())
66- userService.setAuthInfo(
67- name = user.getName(),
68- entryPoint = EntryPoint .GITHUB ,
69- githubUserAuthInfo.id,
70- )
68+ if (user.isAuthInfoSet().not ()) {
69+ val githubUserAuthInfo = githubOpenApi.getGithubUser(user.getName())
70+ userService.setAuthInfo(
71+ name = user.getName(),
72+ entryPoint = EntryPoint .GITHUB ,
73+ githubUserAuthInfo.id,
74+ )
75+ }
76+ }.onFailure {
77+ logger.info(" Fail to update userAuthInfo cause: ${it.message} " , it)
7178 }
7279 }
7380
0 commit comments