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

[enh] faster sync: disable changes API while syncing

parent 45b95588
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ export interface ProgramOptions { ...@@ -20,6 +20,7 @@ export interface ProgramOptions {
nosbx?: boolean nosbx?: boolean
nopeers?: boolean nopeers?: boolean
syncTrace?: string syncTrace?: string
isSync: boolean
} }
export const cliprogram: ProgramOptions = { export const cliprogram: ProgramOptions = {
...@@ -29,4 +30,5 @@ export const cliprogram: ProgramOptions = { ...@@ -29,4 +30,5 @@ export const cliprogram: ProgramOptions = {
nosbx: opts.nosbx, nosbx: opts.nosbx,
nopeers: opts.nopeers, nopeers: opts.nopeers,
syncTrace: opts['sync-trace'], syncTrace: opts['sync-trace'],
isSync: opts._[0] === 'sync'
} }
import {LokiCollection} from "./LokiTypes" import {LokiCollection} from "./LokiTypes"
import {LokiProxyCollection} from "./LokiCollection" import {LokiProxyCollection} from "./LokiCollection"
import {NewLogger} from "../../../logger" import {NewLogger} from "../../../logger"
import {cliprogram} from "../../../common-libs/programOptions"
const logger = NewLogger() const logger = NewLogger()
...@@ -20,7 +21,7 @@ export abstract class LokiCollectionManager<T> { ...@@ -20,7 +21,7 @@ export abstract class LokiCollectionManager<T> {
public triggerInit() { public triggerInit() {
const coll = this.loki.addCollection(this.collectionName, { const coll = this.loki.addCollection(this.collectionName, {
indices: this.indices, indices: this.indices,
disableChangesApi: false disableChangesApi: cliprogram.isSync
}) })
this.collection = new LokiProxyCollection(coll, this.collectionName) this.collection = new LokiProxyCollection(coll, this.collectionName)
this.resolveCollection() this.resolveCollection()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment