Skip to content

Commit

Permalink
fix: 그룹 스코어 갱신 진행시, 웹소켓 메세지 발송 진행
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Sep 4, 2024
1 parent f34e144 commit 9ef529c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.hero.alignlab.config.database.TransactionTemplates
import com.hero.alignlab.domain.group.domain.GroupUser
import com.hero.alignlab.domain.group.domain.GroupUserScore
import com.hero.alignlab.domain.group.infrastructure.GroupUserScoreRepository
import com.hero.alignlab.ws.handler.ReactiveGroupUserWebSocketHandler
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.springframework.stereotype.Service
Expand All @@ -14,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional
class GroupUserScoreService(
private val groupUserScoreRepository: GroupUserScoreRepository,
private val txTemplates: TransactionTemplates,
private val wsHandler: ReactiveGroupUserWebSocketHandler,
) {
suspend fun findAllByGroupId(groupId: Long): List<GroupUserScore> {
return withContext(Dispatchers.IO) {
Expand Down Expand Up @@ -78,6 +80,8 @@ class GroupUserScoreService(
txTemplates.writer.coExecuteOrNull {
saveSync(createOrUpdateGroupUserScore)
}

wsHandler.launchSendEvent(groupUser.groupId)
}

suspend fun findAllByUids(uids: List<Long>): List<GroupUserScore> {
Expand Down

0 comments on commit 9ef529c

Please sign in to comment.