fix threads again

This commit is contained in:
2018-01-17 11:19:16 +01:00
parent 54f18cacf5
commit ff1d240889
2 changed files with 4 additions and 4 deletions

View File

@@ -103,7 +103,7 @@ var UploadManager = /** @class */ (function () {
function UploadManager() {
this.uploadQueue = new Array();
this.uploadThreads = new Array();
this.maxThreads = 2;
this.maxThreads = 3;
}
UploadManager.prototype.uploadFile = function (file) {
console.debug("Adding upload to queue");
@@ -116,7 +116,7 @@ var UploadManager = /** @class */ (function () {
}
else {
for (var i = 0; i < this.uploadThreads.length; i++) {
setTimeout(function () { this.uploadThreads[i].start(); }, 0);
this.uploadThreads[i].start();
}
}
};

View File

@@ -8,7 +8,7 @@ interface FileUpload {
class UploadManager {
private uploadQueue: Array<FileUpload> = new Array();
private uploadThreads: Array<UploadWorker> = new Array();
private maxThreads: number = 2;
private maxThreads: number = 3;
public uploadFile(file: FileUpload) {
console.debug("Adding upload to queue")
@@ -21,7 +21,7 @@ class UploadManager {
setTimeout(function(){thread.start()}, 0) // Start a new upload thread
} else {
for (var i = 0; i < this.uploadThreads.length; i++) {
setTimeout(function(){this.uploadThreads[i].start()}, 0)
this.uploadThreads[i].start()
}
}
}