mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[canvas] Fix setup server expressions cache; move to mount (#108473)
This commit is contained in:
parent
44014c78b6
commit
2d385b339d
2 changed files with 3 additions and 4 deletions
|
@ -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();
|
||||
|
|
|
@ -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 () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue