[fix] smaller chunks, longer keep-alive (#4196)
This commit is contained in:
parent
6afede2aab
commit
9b6ad9022c
2 changed files with 3 additions and 3 deletions
|
|
@ -318,7 +318,7 @@ frappe.socketio.SocketIOUploader = class SocketIOUploader {
|
|||
}
|
||||
|
||||
start({file=null, is_private=0, filename='', callback=null, on_progress=null,
|
||||
chunk_size=100000, fallback=null} = {}) {
|
||||
chunk_size=24576, fallback=null} = {}) {
|
||||
|
||||
if (this.reader) {
|
||||
frappe.throw(__('File Upload in Progress. Please try again in a few moments.'));
|
||||
|
|
@ -360,7 +360,7 @@ frappe.socketio.SocketIOUploader = class SocketIOUploader {
|
|||
}
|
||||
this.next_check = setTimeout (() => {
|
||||
this.disconnect();
|
||||
}, 3000);
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
disconnect(with_message = true) {
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ io.on('connection', function(socket) {
|
|||
socket.files[data.name].data.push(data.data);
|
||||
socket.files[data.name].slice++;
|
||||
|
||||
if (socket.files[data.name].slice * 100000 >= socket.files[data.name].size) {
|
||||
if (socket.files[data.name].slice * 24576 >= socket.files[data.name].size) {
|
||||
// do something with the data
|
||||
var fileBuffer = Buffer.concat(socket.files[data.name].data);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue