up
This commit is contained in:
parent
7e77e3c7c1
commit
0cd8137d2c
3 changed files with 5 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { fork } from 'child_process';
|
import { ChildProcess, fork } from 'child_process';
|
||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
import { DbSettings, MainDbNames } from './db.js';
|
import { DbSettings, MainDbNames } from './db.js';
|
||||||
import { DeepPartial, FindOptionsWhere } from 'typeorm';
|
import { DeepPartial, FindOptionsWhere } from 'typeorm';
|
||||||
|
|
@ -19,7 +19,7 @@ import { serializeRequest, WhereCondition } from './serializationHelpers.js';
|
||||||
export type TX<T> = (txId: string) => Promise<T>
|
export type TX<T> = (txId: string) => Promise<T>
|
||||||
|
|
||||||
export class StorageInterface extends EventEmitter {
|
export class StorageInterface extends EventEmitter {
|
||||||
private process: any;
|
private process: ChildProcess;
|
||||||
private isConnected: boolean = false;
|
private isConnected: boolean = false;
|
||||||
private debug: boolean = false;
|
private debug: boolean = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export class TlvFilesStorage {
|
||||||
|
|
||||||
LoadFile = (app: string, dataName: string, chunk: number): TlvFile => {
|
LoadFile = (app: string, dataName: string, chunk: number): TlvFile => {
|
||||||
if (!this.metaReady || !this.meta[app] || !this.meta[app][dataName] || !this.meta[app][dataName].chunks.includes(chunk)) {
|
if (!this.metaReady || !this.meta[app] || !this.meta[app][dataName] || !this.meta[app][dataName].chunks.includes(chunk)) {
|
||||||
throw new Error("metrics not found")
|
throw new Error(`tlv file for ${app} ${dataName} chunk ${chunk} not found`)
|
||||||
}
|
}
|
||||||
const fullPath = [this.storagePath, app, dataName, `${chunk}.mtlv`].filter(s => !!s).join("/")
|
const fullPath = [this.storagePath, app, dataName, `${chunk}.mtlv`].filter(s => !!s).join("/")
|
||||||
const fileData = fs.readFileSync(fullPath)
|
const fileData = fs.readFileSync(fullPath)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { fork } from 'child_process';
|
import { ChildProcess, fork } from 'child_process';
|
||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
import { AddTlvOperation, ITlvStorageOperation, LoadLatestTlvOperation, LoadTlvFileOperation, NewTlvStorageOperation, TlvOperationResponse, TlvStorageSettings } from './tlvFilesStorageProcessor';
|
import { AddTlvOperation, ITlvStorageOperation, LoadLatestTlvOperation, LoadTlvFileOperation, NewTlvStorageOperation, TlvOperationResponse, TlvStorageSettings } from './tlvFilesStorageProcessor';
|
||||||
import { LatestData, TlvFile } from './tlvFilesStorage';
|
import { LatestData, TlvFile } from './tlvFilesStorage';
|
||||||
|
|
@ -10,7 +10,7 @@ export type TlvStorageInterface = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TlvStorageFactory extends EventEmitter {
|
export class TlvStorageFactory extends EventEmitter {
|
||||||
private process: any;
|
private process: ChildProcess;
|
||||||
private isConnected: boolean = false;
|
private isConnected: boolean = false;
|
||||||
private debug: boolean = false;
|
private debug: boolean = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue