Skip to content

Commit

Permalink
Make order of internal reload event listeners consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Jul 12, 2023
1 parent ef62dc2 commit 702f5ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.inject.Injector;
import com.google.inject.Singleton;
import com.google.inject.TypeLiteral;
import com.seiama.event.EventConfig;
import com.seiama.registry.Registry;
import java.io.IOException;
import java.nio.file.DirectoryStream;
Expand Down Expand Up @@ -115,7 +116,7 @@ public CarbonChannelRegistry(
this.carbonMessages = carbonMessages;
this.eventHandler = events;

events.subscribe(CarbonReloadEvent.class, event -> this.reloadConfigChannels());
events.subscribe(CarbonReloadEvent.class, -99, EventConfig.DEFAULT_ACCEPTS_CANCELLED, event -> this.reloadConfigChannels());
}

public static ConfigurationTransformation.Versioned versioned() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.seiama.event.EventConfig;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down Expand Up @@ -56,7 +57,7 @@ public ConfigFactory(
this.dataDirectory = dataDirectory;
this.locale = locale;

events.subscribe(CarbonReloadEvent.class, event -> this.reloadPrimaryConfig());
events.subscribe(CarbonReloadEvent.class, -100, EventConfig.DEFAULT_ACCEPTS_CANCELLED, event -> this.reloadPrimaryConfig());
}

public @Nullable PrimaryConfig reloadPrimaryConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.seiama.event.EventConfig;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -86,7 +87,7 @@ private CarbonMessageSource(

this.reloadTranslations();

events.subscribe(CarbonReloadEvent.class, event -> {
events.subscribe(CarbonReloadEvent.class, -99, EventConfig.DEFAULT_ACCEPTS_CANCELLED, event -> {
this.reloadTranslations();
});
}
Expand Down

0 comments on commit 702f5ad

Please sign in to comment.