diff --git a/packages/cubejs-backend-native/src/python/template/entry.rs b/packages/cubejs-backend-native/src/python/template/entry.rs index bfc8c07ae8454..6610effe0cd7e 100644 --- a/packages/cubejs-backend-native/src/python/template/entry.rs +++ b/packages/cubejs-backend-native/src/python/template/entry.rs @@ -91,6 +91,9 @@ fn init_template_engine<'a, C: Context<'a>>(_cx: &mut C, opts: EngineOptions) -> ); if let Err(_) = TEMPLATE_ENGINE.set(Mutex::new(engine)) { + // I am working on a new jinja engine implementation on top of isolated instances per tenant + // to support multi tenancy + #[cfg(debug_assertions)] error!("Unable to init jinja engine, it was already started"); } diff --git a/packages/cubejs-schema-compiler/src/compiler/DataSchemaCompiler.js b/packages/cubejs-schema-compiler/src/compiler/DataSchemaCompiler.js index b3185c9277f15..14b29df11429f 100644 --- a/packages/cubejs-schema-compiler/src/compiler/DataSchemaCompiler.js +++ b/packages/cubejs-schema-compiler/src/compiler/DataSchemaCompiler.js @@ -56,14 +56,16 @@ export class DataSchemaCompiler { * @protected */ async doCompile() { - if (NATIVE_IS_SUPPORTED && !isFallbackBuild()) { + const files = await this.repository.dataSchemaFiles(); + const hasJinjaTemplate = files.filter((file) => file.fileName.endsWith('.jinja')); + + if (hasJinjaTemplate && NATIVE_IS_SUPPORTED && !isFallbackBuild()) { initJinjaEngine({ debugInfo: getEnv('devMode'), }); clearTemplates(); } - const files = await this.repository.dataSchemaFiles(); const toCompile = files.filter((f) => !this.filesToCompile || this.filesToCompile.indexOf(f.fileName) !== -1); const errorsReport = new ErrorReporter(null, [], this.errorReport);