Skip to content

Commit

Permalink
Merge pull request #470 from Team-Ampersand/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
esperar authored Dec 10, 2024
2 parents 860a905 + b9ba3c6 commit 2ce41f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/main/kotlin/com/dotori/v2/V2Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import java.util.*
import javax.annotation.PostConstruct

@SpringBootApplication
// @EnableBatchProcessing
class V2Application{

val log = LoggerFactory.getLogger(this::class.java.name)!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ class RedisCacheService(
fun putToCache(key: String, value: Any) {
redisTemplate.opsForValue().set(key, value)

if (key == "memberList") {
if (key == "memberList")
redisTemplate.expire(key, 1, TimeUnit.HOURS)
} else if(key.startsWith("musicList")) {
redisTemplate.expire(key, 10, TimeUnit.MINUTES)
}
}

fun deleteFromCache(key: String) {
redisTemplate.delete(key)
}

fun putToCacheMusic(date: String, value: Any) {
redisTemplate.opsForValue().set("musicList:$date", value)
val key = "musicList:$date"
redisTemplate.opsForValue().set(key, value)
redisTemplate.expire(key, 10, TimeUnit.MINUTES)
}

fun getFromCacheMusic(date: String): Any? {
Expand Down

0 comments on commit 2ce41f7

Please sign in to comment.