Skip to content

Commit e0639b0

Browse files
committed
add scheduledRefreshTimeZones schema validation
1 parent af5833d commit e0639b0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ const schemaOptions = Joi.object().keys({
9292
Joi.boolean(),
9393
Joi.number().min(0).integer()
9494
),
95-
scheduledRefreshTimeZones: Joi.array().items(Joi.string()),
95+
scheduledRefreshTimeZones: Joi.alternatives().try(
96+
Joi.array().items(Joi.string()),
97+
Joi.func()
98+
),
9699
scheduledRefreshContexts: Joi.func(),
97100
scheduledRefreshConcurrency: Joi.number().min(1).integer(),
98101
scheduledRefreshBatchSize: Joi.number().min(1).integer(),

packages/cubejs-server-core/test/unit/OptsHandler.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('OptsHandler class', () => {
7676
}
7777
);
7878

79-
test('must handle vanila CreateOptions', async () => {
79+
test('must handle vanilla CreateOptions', async () => {
8080
process.env.CUBEJS_DB_TYPE = 'postgres';
8181

8282
// Case 1
@@ -432,7 +432,7 @@ describe('OptsHandler class', () => {
432432
testDriverConnectionSpy.mockRestore();
433433
});
434434

435-
test('must determine correcct driver type by the query context', async () => {
435+
test('must determine correct driver type by the query context', async () => {
436436
class Driver1 extends OriginalBaseDriver {
437437
public async testConnection() {
438438
//

0 commit comments

Comments
 (0)