Skip to content

Commit

Permalink
fix: fix velocity startup order
Browse files Browse the repository at this point in the history
  • Loading branch information
dandan2611 committed Apr 28, 2024
1 parent 91cc80a commit fe9ee79
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
dependencies {}

group = "fr.codinbox.redisconnector"
version = "4.0.0"
version = "4.0.1"

val targetJavaVersion = JavaVersion.VERSION_17
java {
Expand Down
2 changes: 1 addition & 1 deletion commons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "fr.codinbox.redisconnector"
version = "4.0.0"
version = "4.0.1"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion paper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "fr.codinbox.redisconnector"
version = "4.0.0"
version = "4.0.1"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion velocity/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "fr.codinbox.redisconnector"
version = "4.0.0"
version = "4.0.1"

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,27 @@
@Plugin(
id = "redisconnector",
name = "redisconnector",
version = "4.0.0"
version = "4.0.1"
)
public class RedisConnectorPlugin {

@Inject
private Logger logger;
private final @NotNull Logger logger;
private final @NotNull ProxyServer server;

@Inject
private ProxyServer server;
public @Inject RedisConnectorPlugin(final @NotNull Logger logger, final @NotNull ProxyServer server) {
this.logger = logger;
this.server = server;

@Subscribe
private void onProxyInit(final @NotNull ProxyInitializeEvent event) {
final var serviceImpl = new RedisConnectorServiceImpl(this.logger);

try {
serviceImpl.init();
RedisConnector.setService(serviceImpl);
} catch (ConnectionInitException exception) {
this.logger.severe("Failed to initialize RedisConnectorService, one or more connections failed to initialize and has exit on failure enabled. Shutting down server.");
this.server.shutdown();
return;
}

RedisConnector.setService(serviceImpl);
}

@Subscribe
Expand Down

0 comments on commit fe9ee79

Please sign in to comment.