Skip to content

Commit

Permalink
Fix infinite loop in nodeConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
stwiname committed May 9, 2023
1 parent ed211a6 commit 1a0ea6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/node-core/src/configure/NodeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class NodeConfig implements IConfig {
}

get storeFlushInterval(): number {
return this.storeFlushInterval;
return this._config.storeFlushInterval;
}

get dictionaryResolver(): string | undefined {
Expand Down
10 changes: 6 additions & 4 deletions packages/node-core/src/indexer/storeCache/storeCache.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ export class StoreCacheService implements BeforeApplicationShutdown {
) {
this.storeCacheThreshold = config.storeCacheThreshold;

const interval = setInterval(
() => void this.flushCache(true, false),
config.storeFlushInterval * 1000 // Convert to miliseconds
this.schedulerRegistry.addInterval(
INTERVAL_NAME,
setInterval(
() => void this.flushCache(true, false),
config.storeFlushInterval * 1000 // Convert to miliseconds
)
);
this.schedulerRegistry.addInterval(INTERVAL_NAME, interval);
}

init(historical: boolean, useCockroachDb: boolean): void {
Expand Down

0 comments on commit 1a0ea6f

Please sign in to comment.