Skip to content

Commit

Permalink
fix: registering event subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
schoenenberg committed Feb 5, 2024
1 parent ac6665a commit 81740c9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ subprojects {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/truzzt/mds-ap3")
version = "0.2.1"
version = "0.2.2"
credentials {
username = System.getenv("USERNAME")
password = System.getenv("TOKEN")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public class LoggingHouseClientExtension implements ServiceExtension {
private URL loggingHouseLogUrl;
public Monitor monitor;

private boolean enabled;


@Override
public String name() {
Expand All @@ -84,12 +86,19 @@ public void initialize(ServiceExtensionContext context) {
var extensionEnabled = context.getSetting(LOGGINGHOUSE_CLIENT_EXTENSION_ENABLED, true);

if (!extensionEnabled) {
enabled = false;
monitor.info("Logginghouse client extension is disabled.");
return;
}
enabled = true;
monitor.info("Logginghouse client extension is enabled.");

loggingHouseLogUrl = readUrlFromSettings(context);

registerSerializerClearingHouseMessages(context);
registerClearingHouseMessageSenders(context);

registerEventSubscriber(context);
}

private URL readUrlFromSettings(ServiceExtensionContext context) {
Expand Down Expand Up @@ -153,7 +162,11 @@ private void registerClearingHouseMessageSenders(ServiceExtensionContext context

@Override
public void start() {
monitor.info("Starting Logginghouse client extension.");
if (!enabled) {
monitor.info("Skipping start of Logginghouse client extension (disabled).");
} else {
monitor.info("Starting Logginghouse client extension.");
}
}

@Override
Expand Down

0 comments on commit 81740c9

Please sign in to comment.