From 4858866569222e6aa64fc8e5ae00beaed5321d10 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Fri, 9 Oct 2015 02:53:16 +0200 Subject: [PATCH] Increase ws timeout + lower sliceLength + console informations --- lib/Lufi/Controller/Files.pm | 2 +- themes/default/public/js/lufi-up.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Lufi/Controller/Files.pm b/lib/Lufi/Controller/Files.pm index aba246a..0c6d1f4 100644 --- a/lib/Lufi/Controller/Files.pm +++ b/lib/Lufi/Controller/Files.pm @@ -13,7 +13,7 @@ use Filesys::DfPortable; sub upload { my $c = shift; - $c->inactivity_timeout(300000); + $c->inactivity_timeout(30000000); $c->debug('Client connected'); $c->on( message => sub { diff --git a/themes/default/public/js/lufi-up.js b/themes/default/public/js/lufi-up.js index dbb4211..30950cd 100644 --- a/themes/default/public/js/lufi-up.js +++ b/themes/default/public/js/lufi-up.js @@ -182,6 +182,8 @@ function sliceAndUpload(randomkey, i, parts, j, delay, del_at_first_view, short) }; data = JSON.stringify(data); + console.log('sending slice '+(j + 1)+'/'+parts+' of file '+file.name);¬ + // Verify that we have a websocket and send json if (window.ws.readyState === 3) { window.ws = spawnWebsocket(function() { @@ -206,6 +208,8 @@ function updateProgressBar(data) { var short = data.short; var created_at = data.created_at; + console.log('getting response for slice '+(j + 1)+'/'+parts+' of file '+data.name); + var dp = document.getElementById('progress-'+window.fc); var key = dp.getAttribute('data-key'); @@ -354,5 +358,5 @@ document.addEventListener('DOMContentLoaded', function() { window.ws = spawnWebsocket(); // Use slice of 10MB - window.sliceLength = 10000000; + window.sliceLength = 2000000; });