Regression: Routing method not available when called from listeners at startup (#23568)

pull/23623/head
Kevin Aleman 4 years ago committed by GitHub
parent d21b9cfb0d
commit 06579aae29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      server/modules/listeners/listeners.module.ts
  2. 5
      server/services/meteor/service.ts

@ -152,7 +152,7 @@ export class ListenersModule {
service.onEvent('watch.inquiries', async ({ clientAction, inquiry, diff }): Promise<void> => {
const config = await getRoutingManagerConfig();
if (config.autoAssignAgent) {
if (!config || config.autoAssignAgent) {
return;
}

@ -282,6 +282,9 @@ export class MeteorService extends ServiceClass implements IMeteor {
}
getRoutingManagerConfig(): IRoutingManagerConfig {
return RoutingManager.getConfig();
// return false if called before routing method is set
// this will cause that oplog events received on early stages of server startup
// won't be fired (at least, inquiry events)
return RoutingManager.isMethodSet() && RoutingManager.getConfig();
}
}

Loading…
Cancel
Save