Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flushCache 사용처 및 메소드 삭제 #288

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class SugangSnuSyncJobConfig {
sugangSnuSyncService.addCoursebook(newCoursebook)
sugangSnuNotificationService.notifyCoursebookUpdate(newCoursebook)
}
sugangSnuSyncService.flushCache()
}
RepeatStatus.FINISHED
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ interface SugangSnuSyncService {
suspend fun addCoursebook(coursebook: Coursebook)

suspend fun isSyncWithSugangSnu(latestCoursebook: Coursebook): Boolean

suspend fun flushCache()
}

@Service
Expand Down Expand Up @@ -85,8 +83,6 @@ class SugangSnuSyncServiceImpl(
return latestCoursebook.isSyncedToSugangSnu(sugangSnuLatestCoursebook)
}

override suspend fun flushCache() = cache.flushDatabase()

private fun compareLectures(
newLectures: Iterable<Lecture>,
oldLectures: Iterable<Lecture>,
Expand Down
7 changes: 0 additions & 7 deletions core/src/main/kotlin/common/cache/Cache.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import kotlinx.coroutines.reactive.awaitSingle
import org.slf4j.LoggerFactory
import org.springframework.data.redis.core.ReactiveStringRedisTemplate
import org.springframework.data.redis.core.deleteAndAwait
Expand All @@ -33,8 +32,6 @@ interface Cache {
suspend fun acquireLock(builtKey: BuiltCacheKey): Boolean

suspend fun releaseLock(builtKey: BuiltCacheKey): Boolean

suspend fun flushDatabase()
}

@Component
Expand Down Expand Up @@ -104,10 +101,6 @@ class RedisCache(
log.debug("[CACHE DEL] {}", builtKey.key)
return redisTemplate.deleteAndAwait(builtKey.key) > 0
}

override suspend fun flushDatabase() {
redisTemplate.execute { it.serverCommands().flushDb() }.awaitSingle()
}
}

suspend inline fun <reified T : Any> Cache.get(
Expand Down
Loading