refactor: move caching configuration to CacheConfig and update application.yml settings
This commit is contained in:
@@ -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 {
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user