refactor: move caching configuration to CacheConfig and update application.yml settings

This commit is contained in:
siujamo
2026-01-28 16:08:51 +08:00
parent 64be3a79ea
commit 9b48869f3f
3 changed files with 13 additions and 5 deletions
@@ -1,20 +1,16 @@
package com.onixbyte.helix;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
/**
* Application entrance.
*
* @author zihluwang
* @see SpringBootApplication
* @see EnableCaching
* @see SpringApplication
* @since 1.0.0
*/
@EnableCaching
@SpringBootApplication
public class HelixApplication {
@@ -1,6 +1,7 @@
package com.onixbyte.helix.config;
import com.onixbyte.helix.extension.redis.serializer.JacksonSerialiser;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
@@ -34,6 +35,7 @@ import java.time.Duration;
* @since 1.0.0
*/
@Configuration
@EnableCaching
public class CacheConfig {
/**
+11 -1
View File
@@ -4,7 +4,7 @@ spring:
cache:
type: redis
redis:
time-to-live: PT1H30M
time-to-live: PT2H
jpa:
properties:
hibernate:
@@ -19,6 +19,11 @@ spring:
hikari:
minimum-idle: 1
maximum-pool-size: 10
data:
redis:
repositories:
# Disable redis repositories
enabled: false
mybatis:
configuration:
@@ -27,3 +32,8 @@ mybatis:
type-aliases-package: com.onixbyte.helix.domain.entity
type-handlers-package: com.onixbyte.helix.extension.mybatis.handler
mapper-locations: classpath:/mapper/*.xml
logging:
level:
org.hibernate:
orm.connections.pooling: off