MCPcopy
hub / github.com/directus/directus / constructor

Method constructor

api/src/flows.ts:76–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74 private envs: Record<string, any>;
75
76 constructor() {
77 const env = useEnv();
78
79 this.envs = env['FLOWS_ENV_ALLOW_LIST'] ? pick(env, toArray(env['FLOWS_ENV_ALLOW_LIST'] as string)) : {};
80
81 const messenger = useBus();
82 const logger = useLogger();
83
84 messenger.subscribe<FlowMessage>('flows', (event) => {
85 if (event.type === 'reload') {
86 this.reloadQueue.add(async () => {
87 if (this.isLoaded) {
88 await this.unload();
89 await this.load();
90 } else {
91 logger.warn('Flows have to be loaded before they can be reloaded');
92 }
93 });
94 }
95 });
96 }
97
98 public async initialize(): Promise<void> {
99 if (!this.isLoaded) {

Callers

nothing calls this directly

Calls 8

unloadMethod · 0.95
loadMethod · 0.95
useEnvFunction · 0.90
toArrayFunction · 0.90
useLoggerFunction · 0.85
subscribeMethod · 0.65
useBusFunction · 0.50
addMethod · 0.45

Tested by

no test coverage detected