fix(): event emitting (#14196)
* fix(): event emitting * Create rude-queens-deny.md * fix(): store subscriber should not be constraint * Update rude-queens-deny.md * Add tests to prevent regression
This commit is contained in:
@@ -87,10 +87,6 @@ export abstract class AbstractEventBusModuleService
|
||||
subscriber: EventBusTypes.Subscriber,
|
||||
context?: EventBusTypes.SubscriberContext
|
||||
): this {
|
||||
if (!this.isWorkerMode) {
|
||||
return this
|
||||
}
|
||||
|
||||
if (typeof subscriber !== `function`) {
|
||||
throw new Error("Subscriber must be a function")
|
||||
}
|
||||
|
||||
@@ -91,11 +91,12 @@ async function loadEntrypoints(
|
||||
ContainerRegistrationKeys.CONFIG_MODULE
|
||||
)
|
||||
|
||||
// Subscribers should be loaded no matter the worker mode, simply they will never handle anything
|
||||
// since worker/shared instances only will have a running worker to process events.
|
||||
await subscribersLoader(plugins, container)
|
||||
|
||||
if (shouldLoadBackgroundProcessors(configModule)) {
|
||||
await promiseAll([
|
||||
subscribersLoader(plugins, container),
|
||||
jobsLoader(plugins, container),
|
||||
])
|
||||
await jobsLoader(plugins, container)
|
||||
}
|
||||
|
||||
if (isWorkerMode(configModule)) {
|
||||
|
||||
Reference in New Issue
Block a user