Skip to content

Commit

Permalink
use multi upload
Browse files Browse the repository at this point in the history
  • Loading branch information
boddumanohar committed Jul 5, 2023
1 parent 3491d9d commit 95aea5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions wasmsdk/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,7 @@ <h2>please download zcn.wasm from https://github.com/0chain/gosdk/releases/lates
}
})
}

// const results = await goWasm.bulkUpload(objects)
const results = await goWasm.multiUpload(objects)

const results = await goWasm.bulkUpload(objects)
console.log(JSON.stringify(results))
}
})
Expand Down
4 changes: 2 additions & 2 deletions wasmsdk/demo/zcn.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ async function bulkUpload(options) {
const readChunkFuncName = "__zcn_upload_reader_"+i.toString()
const callbackFuncName = "__zcn_upload_callback_"+i.toString()
g[readChunkFuncName] = async (offset,chunkSize) => {
console.log("bulk_upload: read chunk remotePath:"+ obj.remotePath + " offset:"+offset+" chunkSize:"+chunkSize)
console.log("multi_upload: read chunk remotePath:"+ obj.remotePath + " offset:"+offset+" chunkSize:"+chunkSize)
const chunk = await readChunk(offset,chunkSize,obj.file)
return chunk.buffer
}
Expand All @@ -170,7 +170,7 @@ async function bulkUpload(options) {
})

const end = bridge.glob.index
const result = await bridge.__proxy__.sdk.bulkUpload(JSON.stringify(opts))
const result = await bridge.__proxy__.sdk.multiUpload(JSON.stringify(opts))
for (let i=start; i<end;i++){
g["__zcn_upload_reader_"+i.toString()] = null;
g["__zcn_upload_callback_"+i.toString()] =null;
Expand Down

0 comments on commit 95aea5d

Please sign in to comment.