fix
This commit is contained in:
parent
84ee279b35
commit
8bca7cb7db
2 changed files with 6 additions and 6 deletions
|
|
@ -62,7 +62,7 @@ export class TlvStorageFactory extends EventEmitter {
|
||||||
|
|
||||||
async LoadLatest(storageName: string, limit?: number): Promise<LatestData> {
|
async LoadLatest(storageName: string, limit?: number): Promise<LatestData> {
|
||||||
const opId = Math.random().toString()
|
const opId = Math.random().toString()
|
||||||
const op: LoadLatestTlvOperation = { type: 'loadLatestTlv', opId, storageName, limit, debug: true }
|
const op: LoadLatestTlvOperation = { type: 'loadLatest', opId, storageName, limit, debug: true }
|
||||||
const latestData = await this.handleOp<SerializableLatestData>(op)
|
const latestData = await this.handleOp<SerializableLatestData>(op)
|
||||||
const deserializedLatestData: LatestData = {}
|
const deserializedLatestData: LatestData = {}
|
||||||
for (const appId in latestData) {
|
for (const appId in latestData) {
|
||||||
|
|
@ -76,7 +76,7 @@ export class TlvStorageFactory extends EventEmitter {
|
||||||
|
|
||||||
async LoadFile(storageName: string, appId: string, dataName: string, chunk: number): Promise<TlvFile> {
|
async LoadFile(storageName: string, appId: string, dataName: string, chunk: number): Promise<TlvFile> {
|
||||||
const opId = Math.random().toString()
|
const opId = Math.random().toString()
|
||||||
const op: LoadTlvFileOperation = { type: 'loadTlvFile', opId, storageName, appId, dataName, chunk, debug: true }
|
const op: LoadTlvFileOperation = { type: 'loadFile', opId, storageName, appId, dataName, chunk, debug: true }
|
||||||
const tlvFile = await this.handleOp<SerializableTlvFile>(op)
|
const tlvFile = await this.handleOp<SerializableTlvFile>(op)
|
||||||
return { fileData: Buffer.from(tlvFile.base64fileData, 'base64'), chunks: tlvFile.chunks }
|
return { fileData: Buffer.from(tlvFile.base64fileData, 'base64'), chunks: tlvFile.chunks }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ export type AddTlvOperation = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export type LoadLatestTlvOperation = {
|
export type LoadLatestTlvOperation = {
|
||||||
type: 'loadLatestTlv'
|
type: 'loadLatest'
|
||||||
opId: string
|
opId: string
|
||||||
storageName: string
|
storageName: string
|
||||||
limit?: number
|
limit?: number
|
||||||
|
|
@ -33,7 +33,7 @@ export type LoadLatestTlvOperation = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export type LoadTlvFileOperation = {
|
export type LoadTlvFileOperation = {
|
||||||
type: 'loadTlvFile'
|
type: 'loadFile'
|
||||||
opId: string
|
opId: string
|
||||||
storageName: string
|
storageName: string
|
||||||
appId: string
|
appId: string
|
||||||
|
|
@ -82,10 +82,10 @@ class TlvFilesStorageProcessor {
|
||||||
case 'addTlv':
|
case 'addTlv':
|
||||||
await this.handleAddTlv(operation);
|
await this.handleAddTlv(operation);
|
||||||
break;
|
break;
|
||||||
case 'loadLatestTlv':
|
case 'loadLatest':
|
||||||
await this.handleLoadLatestTlv(operation);
|
await this.handleLoadLatestTlv(operation);
|
||||||
break;
|
break;
|
||||||
case 'loadTlvFile':
|
case 'loadFile':
|
||||||
await this.handleLoadTlvFile(operation);
|
await this.handleLoadTlvFile(operation);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue