[canvas] Fix setup server expressions cache; move to mount (#108473)

This commit is contained in:
Clint Andrew Hall 2021-08-13 12:19:16 -05:00 committed by GitHub
parent 44014c78b6
commit 2d385b339d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -95,8 +95,6 @@ export class CanvasPlugin
}));
}
setupExpressions({ coreSetup, setupPlugins });
coreSetup.application.register({
category: DEFAULT_APP_CATEGORIES.kibana,
id: 'canvas',
@ -108,6 +106,7 @@ export class CanvasPlugin
const { CanvasSrcPlugin } = await import('../canvas_plugin_src/plugin');
const srcPlugin = new CanvasSrcPlugin();
srcPlugin.setup(coreSetup, { canvas: canvasApi });
setupExpressions({ coreSetup, setupPlugins });
// Get start services
const [coreStart, startPlugins] = await coreSetup.getStartServices();

View file

@ -11,6 +11,8 @@ import { API_ROUTE_FUNCTIONS } from '../common/lib/constants';
import { CanvasSetupDeps } from './plugin';
let cached: Promise<void> | null = null;
// TODO: clintandrewhall - This is getting refactored shortly. https://github.com/elastic/kibana/issues/105675
export const setupExpressions = async ({
coreSetup,
@ -21,8 +23,6 @@ export const setupExpressions = async ({
}) => {
const { expressions, bfetch } = setupPlugins;
let cached: Promise<void> | null = null;
const loadServerFunctionWrappers = async () => {
if (!cached) {
cached = (async () => {