Skip to content
Snippets Groups Projects
Commit a1b7fe76 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] memory consumption during sync was too high

parent f5211396
Branches
Tags
No related merge requests found
...@@ -23,7 +23,6 @@ import {AbstractSynchronizer} from "../AbstractSynchronizer" ...@@ -23,7 +23,6 @@ import {AbstractSynchronizer} from "../AbstractSynchronizer"
import {cliprogram} from "../../../../../lib/common-libs/programOptions" import {cliprogram} from "../../../../../lib/common-libs/programOptions"
import {DBHead} from "../../../../../lib/db/DBHead" import {DBHead} from "../../../../../lib/db/DBHead"
import {Watcher} from "../Watcher" import {Watcher} from "../Watcher"
import {LokiDividend} from "../../../../../lib/dal/indexDAL/loki/LokiDividend"
import {DataErrors} from "../../../../../lib/common-libs/errors" import {DataErrors} from "../../../../../lib/common-libs/errors"
import {ProtocolIndexesStream} from "./ProtocolIndexesStream" import {ProtocolIndexesStream} from "./ProtocolIndexesStream"
...@@ -100,7 +99,7 @@ export class GlobalIndexStream extends Duplex { ...@@ -100,7 +99,7 @@ export class GlobalIndexStream extends Duplex {
} }
this.memSyncInjection = (async () => { this.memSyncInjection = (async () => {
await this.injectLoki(this.dal, 'dividendDAL', new LokiDividend(new loki())) // TODO // Disabled function
})() })()
} }
...@@ -420,6 +419,8 @@ export class GlobalIndexStream extends Duplex { ...@@ -420,6 +419,8 @@ export class GlobalIndexStream extends Duplex {
// Persist the memory wotb // Persist the memory wotb
this.wotbMem.fileCopy(this.dal.wotb.filePath) this.wotbMem.fileCopy(this.dal.wotb.filePath)
const that = this const that = this
// Disabled for now
async function inject<T, K extends keyof T, R, S extends T[K]>(fileDal: T, field: K, getRows: () => Promise<R[]>) { async function inject<T, K extends keyof T, R, S extends T[K]>(fileDal: T, field: K, getRows: () => Promise<R[]>) {
const dao = that.mapInjection[field] const dao = that.mapInjection[field]
if (dao) { if (dao) {
...@@ -433,9 +434,6 @@ export class GlobalIndexStream extends Duplex { ...@@ -433,9 +434,6 @@ export class GlobalIndexStream extends Duplex {
} }
} }
await inject(this.dal, 'dividendDAL',
() => this.dal.dividendDAL.listAll())
this.memToCopyDone = true this.memToCopyDone = true
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment