Sync sansei branch #1
@ -0,0 +1,22 @@
|
|||||||
|
package com.nisemoe.nise.config
|
||||||
|
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties
|
||||||
|
import org.springframework.boot.jdbc.DataSourceBuilder
|
||||||
|
import org.springframework.context.annotation.Bean
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
|
import org.springframework.context.annotation.Primary
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement
|
||||||
|
import javax.sql.DataSource
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableTransactionManagement
|
||||||
|
class DataSourceConfig {
|
||||||
|
@Primary
|
||||||
|
@Bean(name = ["niseDataSource"])
|
||||||
|
@ConfigurationProperties(prefix = "spring.datasource.nise")
|
||||||
|
fun niseDataSource(): DataSource = DataSourceBuilder.create().build()
|
||||||
|
|
||||||
|
@Bean(name = ["replayCacheDataSource"])
|
||||||
|
@ConfigurationProperties(prefix = "spring.datasource.replay-cache")
|
||||||
|
fun replayCacheDataSource(): DataSource = DataSourceBuilder.create().build()
|
||||||
|
}
|
||||||
@ -1,14 +0,0 @@
|
|||||||
spring.datasource.url=jdbc:postgresql://${POSTGRES_HOST:postgres}:${POSTGRES_PORT:5432}/${POSTGRES_DB:postgres}?currentSchema=public
|
|
||||||
spring.datasource.username=${POSTGRES_USER:postgres}
|
|
||||||
spring.datasource.password=${POSTGRES_PASS:postgres}
|
|
||||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
|
||||||
spring.datasource.name=HikariPool-PostgreSQL
|
|
||||||
|
|
||||||
spring.flyway.enabled=${FLYWAY_ENABLED:true}
|
|
||||||
spring.flyway.schemas=public
|
|
||||||
|
|
||||||
# Batching
|
|
||||||
spring.datasource.hikari.data-source-properties.prepStmtCacheSize=250
|
|
||||||
spring.datasource.hikari.data-source-properties.prepStmtCacheSqlLimit=2048
|
|
||||||
spring.datasource.hikari.data-source-properties.useServerPrepStmts=true
|
|
||||||
spring.datasource.hikari.data-source-properties.rewriteBatchedStatements=true
|
|
||||||
@ -32,4 +32,25 @@ spring.security.oauth2.client.registration.osu.provider=osu
|
|||||||
spring.security.oauth2.client.provider.osu.authorization-uri=https://osu.ppy.sh/oauth/authorize
|
spring.security.oauth2.client.provider.osu.authorization-uri=https://osu.ppy.sh/oauth/authorize
|
||||||
spring.security.oauth2.client.provider.osu.token-uri=https://osu.ppy.sh/oauth/token
|
spring.security.oauth2.client.provider.osu.token-uri=https://osu.ppy.sh/oauth/token
|
||||||
spring.security.oauth2.client.provider.osu.user-info-uri=https://osu.ppy.sh/api/v2/me/osu
|
spring.security.oauth2.client.provider.osu.user-info-uri=https://osu.ppy.sh/api/v2/me/osu
|
||||||
spring.security.oauth2.client.provider.osu.user-name-attribute=username
|
spring.security.oauth2.client.provider.osu.user-name-attribute=username
|
||||||
|
|
||||||
|
spring.datasource.nise.jdbcUrl=jdbc:postgresql://${POSTGRES_HOST:postgres}:${POSTGRES_PORT:5432}/${POSTGRES_DB:postgres}?currentSchema=public
|
||||||
|
spring.datasource.nise.username=${POSTGRES_USER:postgres}
|
||||||
|
spring.datasource.nise.password=${POSTGRES_PASS:postgres}
|
||||||
|
spring.datasource.nise.driver-class-name=org.postgresql.Driver
|
||||||
|
spring.datasource.nise.name=HikariPool-PostgreSQL
|
||||||
|
|
||||||
|
spring.datasource.replay-cache.jdbcUrl=jdbc:postgresql://${REPLAY_CACHE_HOST:postgres}:${REPLAY_CACHE_PORT:5433}/${REPLAY_CACHE_DB:REPLAY_CACHE}?currentSchema=public
|
||||||
|
spring.datasource.replay-cache.username=${REPLAY_CACHE_USER:postgres}
|
||||||
|
spring.datasource.replay-cache.password=${REPLAY_CACHE_PASS:postgres}
|
||||||
|
spring.datasource.replay-cache.driver-class-name=org.postgresql.Driver
|
||||||
|
spring.datasource.replay-cache.name=HikariPool-PostgreSQL
|
||||||
|
|
||||||
|
spring.flyway.enabled=${FLYWAY_ENABLED:true}
|
||||||
|
spring.flyway.schemas=public
|
||||||
|
|
||||||
|
# Batching
|
||||||
|
spring.datasource.hikari.data-source-properties.prepStmtCacheSize=250
|
||||||
|
spring.datasource.hikari.data-source-properties.prepStmtCacheSqlLimit=2048
|
||||||
|
spring.datasource.hikari.data-source-properties.useServerPrepStmts=true
|
||||||
|
spring.datasource.hikari.data-source-properties.rewriteBatchedStatements=true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user