diff --git a/src/services/storage/db/storageInterface.ts b/src/services/storage/db/storageInterface.ts index a7a04f78..94a52fb0 100644 --- a/src/services/storage/db/storageInterface.ts +++ b/src/services/storage/db/storageInterface.ts @@ -1,4 +1,4 @@ -import { fork } from 'child_process'; +import { ChildProcess, fork } from 'child_process'; import { EventEmitter } from 'events'; import { DbSettings, MainDbNames } from './db.js'; import { DeepPartial, FindOptionsWhere } from 'typeorm'; @@ -19,7 +19,7 @@ import { serializeRequest, WhereCondition } from './serializationHelpers.js'; export type TX = (txId: string) => Promise export class StorageInterface extends EventEmitter { - private process: any; + private process: ChildProcess; private isConnected: boolean = false; private debug: boolean = false; diff --git a/src/services/storage/tlv/tlvFilesStorage.ts b/src/services/storage/tlv/tlvFilesStorage.ts index 801fcc40..22b93e14 100644 --- a/src/services/storage/tlv/tlvFilesStorage.ts +++ b/src/services/storage/tlv/tlvFilesStorage.ts @@ -27,7 +27,7 @@ export class TlvFilesStorage { 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)) { - 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 fileData = fs.readFileSync(fullPath) diff --git a/src/services/storage/tlv/tlvFilesStorageFactory.ts b/src/services/storage/tlv/tlvFilesStorageFactory.ts index 810996a9..edf48bb3 100644 --- a/src/services/storage/tlv/tlvFilesStorageFactory.ts +++ b/src/services/storage/tlv/tlvFilesStorageFactory.ts @@ -1,4 +1,4 @@ -import { fork } from 'child_process'; +import { ChildProcess, fork } from 'child_process'; import { EventEmitter } from 'events'; import { AddTlvOperation, ITlvStorageOperation, LoadLatestTlvOperation, LoadTlvFileOperation, NewTlvStorageOperation, TlvOperationResponse, TlvStorageSettings } from './tlvFilesStorageProcessor'; import { LatestData, TlvFile } from './tlvFilesStorage'; @@ -10,7 +10,7 @@ export type TlvStorageInterface = { } export class TlvStorageFactory extends EventEmitter { - private process: any; + private process: ChildProcess; private isConnected: boolean = false; private debug: boolean = false;