File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
packages/cubejs-server-core/core Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,7 @@ CubejsServerCore.create({
334
334
### scheduledRefreshTimer
335
335
336
336
Pass ` true ` to enable default every 5 second scheduled refresh timer with default querying options.
337
+ Can be also set using ` CUBEJS_SCHEDULED_REFRESH_TIMER ` env variable.
337
338
Each timer invocation will call ` runScheduledRefresh() ` method as in:
338
339
339
340
``` javascript
Original file line number Diff line number Diff line change @@ -222,10 +222,14 @@ class CubejsServerCore {
222
222
setInterval ( ( ) => this . compilerCache . prune ( ) , options . maxCompilerCacheKeepAlive ) ;
223
223
}
224
224
225
- if ( options . scheduledRefreshTimer ) {
225
+ this . scheduledRefreshTimer = options . scheduledRefreshTimer || process . env . CUBEJS_SCHEDULED_REFRESH_TIMER ;
226
+
227
+ if ( this . scheduledRefreshTimer ) {
226
228
setInterval (
227
229
( ) => this . runScheduledRefresh ( ) ,
228
- typeof options . scheduledRefreshTimer === 'number' ? ( options . scheduledRefreshTimer * 1000 ) : 5000
230
+ typeof this . scheduledRefreshTimer === 'number' || this . scheduledRefreshTimer . match ( / ^ \d + $ / ) ?
231
+ ( this . scheduledRefreshTimer * 1000 ) :
232
+ 5000
229
233
) ;
230
234
}
231
235
You can’t perform that action at this time.
0 commit comments