Fix file write streaming logic

This commit is contained in:
2020-11-29 11:54:11 -06:00
parent d1e9d38f53
commit 203dda2abb
2 changed files with 6 additions and 5 deletions

View File

@@ -6,10 +6,10 @@ const Streamer = require('../Streamer')
module.exports = exports = async function (path, fd, buffer, length, position, cb) {
try {
const { socket_uuid, node_uuid } = await connector.simple_request('stream.getfd', { descriptor: fd })
console.log({socket_uuid, node_uuid})
const { socket_uuid, node_uuid, descriptor } = await connector.simple_request('stream.getfd', { descriptor: fd })
console.log({socket_uuid, node_uuid, descriptor})
const streamer = new Streamer(socket_uuid, node_uuid, length, position)
const streamer = new Streamer(socket_uuid, node_uuid, length, position, descriptor)
streamer.write(buffer).then(() => {
return process.nextTick(cb, length)
})