@nger/fk-upload 1.0.74 → 1.0.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,9 +37,13 @@ let CheckUploadController = class CheckUploadController {
|
|
37
37
|
}
|
38
38
|
async checkSpace() {
|
39
39
|
const download = this.db.manager.getRepository(fk_download_task_entity_1.FkDownloadTaskEntity);
|
40
|
+
// remove to large
|
41
|
+
const largs = await download.find({ where: { totalSize: (0, typeorm_2.MoreThan)(1024 * 1024 * 1024) } });
|
42
|
+
// remove not use
|
43
|
+
// remove finish
|
40
44
|
const list = await download.find({ where: { status: (0, typeorm_2.In)([2, 3]) } });
|
41
45
|
const removes = [];
|
42
|
-
list.map(item => {
|
46
|
+
[...list, ...largs].map(item => {
|
43
47
|
if ((0, fs_1.existsSync)(item.path)) {
|
44
48
|
(0, fs_extra_1.unlink)(item.path);
|
45
49
|
}
|
@@ -162,7 +162,7 @@ let FkService = class FkService {
|
|
162
162
|
task.uploadUrl = fullUrl;
|
163
163
|
}
|
164
164
|
}
|
165
|
-
console.log(`uploading ${task.filename} ${Math.floor((index + 1 / task.totalChunks)
|
165
|
+
console.log(`uploading ${task.filename} ${Math.floor((index + 1 / task.totalChunks))}%`);
|
166
166
|
index = index + 1;
|
167
167
|
} while (!complete);
|
168
168
|
// upload complete
|