Skip to content

Commit

Permalink
fix(module-tools): module name not correctly converted for subscripti…
Browse files Browse the repository at this point in the history
…ons (#819)

* fix(module-tools): module name not correctly converted for subscriptions

* chore(module-tools): import clean
  • Loading branch information
kkopanidis authored Nov 24, 2023
1 parent 68bac6c commit 5898a8f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions libraries/module-tools/src/ManagedModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import ConduitGrpcSdk, {
SetConfigRequest,
SetConfigResponse,
} from '@conduitplatform/grpc-sdk';
import { merge } from './utilities';
import { initializeSdk, merge } from './utilities';
import { convictConfigParser } from './utilities/convictConfigParser';
import { initializeSdk } from './utilities/initializeSdk';
import { RoutingManager } from './routing';
import { RoutingController } from './routing/RoutingController';
import { ModuleLifecycleStage } from './interfaces/ModuleLifecycleStage';
Expand Down Expand Up @@ -219,10 +218,13 @@ export abstract class ManagedModule<T> extends ConduitServiceModule {
/** Used to update the module's configuration on initial Redis/DB reconciliation. */
async handleConfigSyncUpdate() {
if (!this.config) return;
this.grpcSdk.bus!.subscribe(`${this.name}:config:update`, async (message: string) => {
ConfigController.getInstance().config = await this.preConfig(JSON.parse(message));
await this.onConfig();
});
this.grpcSdk.bus!.subscribe(
`${kebabCase(this.name)}:config:update`,
async (message: string) => {
ConfigController.getInstance().config = await this.preConfig(JSON.parse(message));
await this.onConfig();
},
);
}

private async preRegisterLifecycle(): Promise<void> {
Expand Down

0 comments on commit 5898a8f

Please sign in to comment.