Compare commits
2 Commits
58db913275
...
7f7da8a619
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f7da8a619 | ||
|
|
8d1d641f97 |
@ -179,10 +179,27 @@ async function installUpdate(onProgress) {
|
|||||||
let downloadedBytes = 0;
|
let downloadedBytes = 0;
|
||||||
const chunks = [];
|
const chunks = [];
|
||||||
|
|
||||||
|
const DOWNLOAD_STALL_MS = 45000;
|
||||||
|
let stallTimer = null;
|
||||||
const reader = res.body.getReader();
|
const reader = res.body.getReader();
|
||||||
while (true) {
|
while (true) {
|
||||||
if (signal.aborted) throw new Error('Abgebrochen');
|
if (signal.aborted) throw new Error('Abgebrochen');
|
||||||
const { done, value } = await reader.read();
|
let chunk;
|
||||||
|
try {
|
||||||
|
chunk = await Promise.race([
|
||||||
|
reader.read(),
|
||||||
|
new Promise((_, reject) => { stallTimer = setTimeout(() => reject(new Error('__STALL__')), DOWNLOAD_STALL_MS); })
|
||||||
|
]);
|
||||||
|
} catch (e) {
|
||||||
|
if (e && e.message === '__STALL__') {
|
||||||
|
try { activeAbort.abort(); } catch {}
|
||||||
|
throw new Error('Download hängt — seit 45 s keine Daten (Netzwerk/Server überlastet). Bitte laufende Uploads stoppen und erneut versuchen.');
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
} finally {
|
||||||
|
if (stallTimer) { clearTimeout(stallTimer); stallTimer = null; }
|
||||||
|
}
|
||||||
|
const { done, value } = chunk;
|
||||||
if (done) break;
|
if (done) break;
|
||||||
chunks.push(value);
|
chunks.push(value);
|
||||||
downloadedBytes += value.length;
|
downloadedBytes += value.length;
|
||||||
|
|||||||
1
main.js
1
main.js
@ -2294,6 +2294,7 @@ ipcMain.handle('app:check-updates', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.handle('app:install-update', () => {
|
ipcMain.handle('app:install-update', () => {
|
||||||
|
try { if (uploadManager) uploadManager.cancel(); } catch {}
|
||||||
installUpdate((progress) => {
|
installUpdate((progress) => {
|
||||||
safeSend('app:update-progress', progress);
|
safeSend('app:update-progress', progress);
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "3.3.94",
|
"version": "3.3.95",
|
||||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user