monitor method

void monitor(
  1. Timer t
)

Implementation

void monitor(Timer t) {
	//Log("monitor");

	if (!this.isUploading) {
		t.cancel();
	}

	for (var i = 0; i < this.files.length; i++) {
		if (this.files[i]['loadedSize'] < this.files[i]['fileSize'] &&
			this.files[i]['loadedSize'] - this.files[i]['lastLoadedSize'] < this.config['cancelThreshold']) {
			Log("upload is too slow: file = " + this.files[i]['fileName']);
			// [TODO] shall we cancel this upload?
			//this.abortEntireUpload();
		}
		this.files[i]['lastLoadedSize'] = this.files[i]['loadedSize'];
	}
}