mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-12-25 17:08:27 +01:00
Don't isolate MariaDB driver, update DynamicProxy usage
This commit is contained in:
parent
affa127906
commit
28dbbb8466
@ -94,7 +94,7 @@ subprojects {
|
||||
testRuntimeOnly(libs.jupiter.engine)
|
||||
|
||||
// DynamicProxy
|
||||
annotationProcessor(libs.dynamicproxy)
|
||||
annotationProcessor(libs.dynamicproxy.api)
|
||||
}
|
||||
|
||||
test {
|
||||
|
@ -71,10 +71,8 @@ dependencies {
|
||||
runtimeDownloadApi(libs.caffeine)
|
||||
|
||||
// DynamicProxy
|
||||
runtimeDownloadApi(libs.dynamicproxy) {
|
||||
// Not needed at runtime
|
||||
exclude module: 'javaparser-symbol-solver-core'
|
||||
}
|
||||
compileOnlyApi(libs.dynamicproxy.api)
|
||||
runtimeDownloadApi(libs.dynamicproxy.runtime)
|
||||
|
||||
// Jackson (transitive in :api)
|
||||
compileOnlyApi(libs.jackson.databind)
|
||||
@ -96,10 +94,7 @@ dependencies {
|
||||
runtimeDownloadApi(libs.enhancedlegacytext)
|
||||
|
||||
// Database
|
||||
hikariOnly(libs.hikaricp) {
|
||||
// Already provided
|
||||
exclude group: 'org.slf4j'
|
||||
}
|
||||
hikariOnly(libs.hikaricp)
|
||||
h2DriverOnly(libs.h2)
|
||||
mysqlDriverOnly(libs.mysql)
|
||||
mariadbDriverOnly(libs.mariadb)
|
||||
|
@ -4,7 +4,6 @@ import com.discordsrv.common.DiscordSRV;
|
||||
import com.discordsrv.common.config.connection.StorageConfig;
|
||||
import com.discordsrv.common.exception.StorageException;
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import dev.vankka.dependencydownload.classloader.IsolatedClassLoader;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.Connection;
|
||||
@ -12,8 +11,6 @@ import java.sql.SQLException;
|
||||
|
||||
public class MariaDBStorage extends HikariStorage {
|
||||
|
||||
private IsolatedClassLoader classLoader;
|
||||
|
||||
public MariaDBStorage(DiscordSRV discordSRV) {
|
||||
super(discordSRV);
|
||||
}
|
||||
@ -21,19 +18,13 @@ public class MariaDBStorage extends HikariStorage {
|
||||
@Override
|
||||
public void close() {
|
||||
super.close();
|
||||
if (classLoader != null) {
|
||||
try {
|
||||
classLoader.close();
|
||||
} catch (IOException e) {
|
||||
discordSRV.logger().error("Failed to close isolated classloader", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
try {
|
||||
initializeWithContext(classLoader = discordSRV.dependencyManager().mariadb().loadIntoIsolated());
|
||||
discordSRV.dependencyManager().mariadb().download().join();
|
||||
super.initialize();
|
||||
} catch (IOException e) {
|
||||
throw new StorageException(e);
|
||||
}
|
||||
|
@ -72,7 +72,9 @@ dependencyResolutionManagement {
|
||||
}
|
||||
|
||||
// DynamicProxy
|
||||
library('dynamicproxy', 'dev.vankka', 'dynamicproxy').version('1.0.0')
|
||||
version('dynamicproxy', '1.0.1-SNAPSHOT')
|
||||
library('dynamicproxy-api', 'dev.vankka', 'dynamicproxy').versionRef('dynamicproxy')
|
||||
library('dynamicproxy-runtime', 'dev.vankka', 'dynamicproxy-runtime').versionRef('dynamicproxy')
|
||||
|
||||
// Jackson
|
||||
library('jackson-databind', 'com.fasterxml.jackson.core', 'jackson-databind').version('2.14.2')
|
||||
|
Loading…
Reference in New Issue
Block a user