@nger/fk-upload 1.0.66 → 1.0.67
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.
@@ -12,6 +12,7 @@ class UploadTask extends rabbitmq_1.Task {
|
|
12
12
|
constructor() {
|
13
13
|
super(actions_1.UPLOAD_ACTION);
|
14
14
|
}
|
15
|
+
runingCount = 0;
|
15
16
|
async handle(injector, next) {
|
16
17
|
const task = injector.get(rabbitmq_1.DATA);
|
17
18
|
const complete = injector.get(rabbitmq_1.COMPLETE);
|
@@ -33,6 +34,10 @@ class UploadTask extends rabbitmq_1.Task {
|
|
33
34
|
complete();
|
34
35
|
}
|
35
36
|
if (old.status === 1) {
|
37
|
+
if (this.runingCount > 3) {
|
38
|
+
throw new Error(`system is busy`);
|
39
|
+
}
|
40
|
+
this.runingCount += 1;
|
36
41
|
// upload
|
37
42
|
await fk.startUploadFile(task).then(async (res) => {
|
38
43
|
// create effect task
|