Skip to content

Commit

Permalink
Normalize configuration between cache-updater and http-service
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Slusny <[email protected]>
  • Loading branch information
deathbeam authored and Adam- committed Mar 24, 2019
1 parent 4500b74 commit 94a0ee5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
7 changes: 0 additions & 7 deletions cache-updater/application.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,18 @@
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.sql2o.Sql2o;
import org.sql2o.converters.Converter;
import org.sql2o.quirks.NoQuirks;

@Configuration
public class CacheConfiguration
{
@Value("${jdbc.url}")
private String jdbcUrl;

@Value("${jdbc.username}")
private String jdbcUsername;

@Value("${jdbc.password}")
private String jdbcPassword;

@Value("${minio.url}")
@Value("${minio.endpoint}")
private String minioUrl;

@Value("${minio.accesskey}")
Expand All @@ -62,13 +54,10 @@ public class CacheConfiguration
private String minioSecretKey;

@Bean
@ConfigurationProperties(prefix = "datasource.runelite-cache")
public DataSource dataSource()
{
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setUrl(jdbcUrl);
dataSource.setUsername(jdbcUsername);
dataSource.setPassword(jdbcPassword);
return dataSource;
return DataSourceBuilder.create().build();
}

@Bean
Expand Down
16 changes: 16 additions & 0 deletions cache-updater/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# Database
datasource:
runelite-cache:
driverClassName: com.mysql.jdbc.Driver
type: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
url: jdbc:mysql://localhost/runelite-cache
username: runelite
password: runelite

# Minio client storage for cache
minio:
endpoint: http://localhost:9000
accesskey: AM54M27O4WZK65N6F8IP
secretkey: /PZCxzmsJzwCHYlogcymuprniGCaaLUOET2n6yMP
bucket: runelite

0 comments on commit 94a0ee5

Please sign in to comment.