Skip to content

Commit 578dac8

Browse files
asmishaMikhail Astashkevich
authored andcommitted
chore(fast-reload): support fastReloadEnabled as a server option (#9294)
* chore(fast-reload): support fastReloadEnabled as a server option * rename and add to python and rust
1 parent e03c8bc commit 578dac8

File tree

8 files changed

+11
-4
lines changed

8 files changed

+11
-4
lines changed

packages/cubejs-backend-native/python/cube/src/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class Configuration:
7777
semantic_layer_sync: Union[Dict, Callable[[], Dict]]
7878
pre_aggregations_schema: Union[Callable[[RequestContext], str]]
7979
orchestrator_options: Union[Dict, Callable[[RequestContext], Dict]]
80+
fast_reload: bool
8081

8182
def __init__(self):
8283
self.web_sockets = None
@@ -125,6 +126,7 @@ def __init__(self):
125126
self.semantic_layer_sync = None
126127
self.pre_aggregations_schema = None
127128
self.orchestrator_options = None
129+
self.fast_reload = None
128130

129131
def __call__(self, func):
130132
if isinstance(func, str):

packages/cubejs-backend-native/src/python/cube_config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ impl CubeConfigPy {
6363
"schema_version",
6464
"pre_aggregations_schema",
6565
"orchestrator_options",
66+
"fast_reload",
6667
]
6768
}
6869

packages/cubejs-backend-shared/src/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ const variables: Record<string, (...args: any) => any> = {
17851785

17861786
return undefined;
17871787
},
1788-
fastReloadEnabled: () => get('CUBEJS_FAST_RELOAD_ENABLED')
1788+
fastReload: () => get('CUBEJS_FAST_RELOAD_ENABLED')
17891789
.default('false')
17901790
.asBoolStrict(),
17911791
};

packages/cubejs-server-core/src/core/CompilerApi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class CompilerApi {
5353
compilerVersion = JSON.stringify(compilerVersion);
5454
}
5555

56-
if (this.options.devServer || this.options.fastReloadEnabled) {
56+
if (this.options.devServer || this.options.fastReload) {
5757
const files = await this.repository.dataSchemaFiles();
5858
compilerVersion += `_${crypto.createHash('md5').update(JSON.stringify(files)).digest('hex')}`;
5959
}

packages/cubejs-server-core/src/core/OptsHandler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,8 @@ export class OptsHandler {
482482
jwkUrl: getEnv('jwkUrl'),
483483
claimsNamespace: getEnv('jwtClaimsNamespace'),
484484
...opts.jwt,
485-
}
485+
},
486+
fastReload: getEnv('fastReload'),
486487
};
487488

488489
if (opts.contextToAppId && !opts.scheduledRefreshContexts) {

packages/cubejs-server-core/src/core/optionsValidate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ const schemaOptions = Joi.object().keys({
142142
// Additional system flags
143143
serverless: Joi.boolean(),
144144
allowNodeRequire: Joi.boolean(),
145+
fastReload: Joi.boolean(),
145146
});
146147

147148
export default (options: any) => {

packages/cubejs-server-core/src/core/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ export class CubejsServerCore {
516516
context,
517517
allowJsDuplicatePropsInSchema: this.options.allowJsDuplicatePropsInSchema,
518518
allowNodeRequire: this.options.allowNodeRequire,
519+
fastReload: this.options.fastReload,
519520
},
520521
);
521522

@@ -689,7 +690,7 @@ export class CubejsServerCore {
689690
sqlCache: this.options.sqlCache,
690691
standalone: this.standalone,
691692
allowNodeRequire: options.allowNodeRequire,
692-
fastReloadEnabled: options.fastReloadEnabled || getEnv('fastReloadEnabled'),
693+
fastReload: options.fastReload || getEnv('fastReload'),
693694
},
694695
);
695696
}

packages/cubejs-server-core/src/core/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export interface CreateOptions {
216216
serverless?: boolean;
217217
allowNodeRequire?: boolean;
218218
semanticLayerSync?: (context: RequestContext) => Promise<BiToolSyncConfig[]> | BiToolSyncConfig[];
219+
fastReload?: boolean;
219220
}
220221

221222
export interface DriverDecoratedOptions extends CreateOptions {

0 commit comments

Comments
 (0)