mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
new way to invoke merge
This commit is contained in:
@@ -214,22 +214,11 @@ export class PublicationFormMV {
|
||||
|
||||
if(!PublicationAttachmentEntity.hasChunkManger) {
|
||||
const fileBlob = PublicationAttachmentEntity.blobFile;
|
||||
const fileChunks = new Chunks({chunkSize: 1024 })
|
||||
const fileChunks = new Chunks({chunkSize: 40 })
|
||||
fileChunks.setFile(fileBlob)
|
||||
|
||||
PublicationAttachmentEntity.setChunkManger(fileChunks)
|
||||
|
||||
PublicationAttachmentEntity.chucksManager.registerOnLastChunk(() => {
|
||||
this.ObjectMergeNotification.socket.commit(PublicationAttachmentEntity.chucksManager.path)
|
||||
|
||||
const guid = PublicationAttachmentEntity.chucksManager.path
|
||||
|
||||
this.ObjectMergeNotification.subscribe(guid, (data) => {
|
||||
PublicationAttachmentEntity
|
||||
resolve(true)
|
||||
})
|
||||
})
|
||||
|
||||
} else if(PublicationAttachmentEntity.chucksManager.doneUpload) {
|
||||
return resolve(true)
|
||||
}
|
||||
@@ -250,11 +239,17 @@ export class PublicationFormMV {
|
||||
} while (attemp<3 && result.isErr() && result?.error == 'slow')
|
||||
|
||||
PublicationAttachmentEntity.chucksManager.setManualRetry()
|
||||
PublicationAttachmentEntity.chucksManager.doneChunkUpload()
|
||||
|
||||
if(result.isErr()) {
|
||||
resolve(false)
|
||||
} else {
|
||||
const guid = PublicationAttachmentEntity.chucksManager.path
|
||||
this.ObjectMergeNotification.subscribe(guid, (data) => {
|
||||
PublicationAttachmentEntity
|
||||
resolve(true)
|
||||
})
|
||||
PublicationAttachmentEntity.chucksManager.doneChunkUpload()
|
||||
this.ObjectMergeNotification.socket.commit(PublicationAttachmentEntity.chucksManager.path)
|
||||
resolve(true)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user