Fix CI
This commit is contained in:
parent
d3fa901691
commit
e4872c6f9d
@ -63,7 +63,7 @@ export class FileController extends BaseController {
|
|||||||
console.log('READING FILE', fieldname)
|
console.log('READING FILE', fieldname)
|
||||||
|
|
||||||
const chunks: Buffer[] = []
|
const chunks: Buffer[] = []
|
||||||
for await (let chunk of file) {
|
for await (const chunk of file) {
|
||||||
if (!(chunk instanceof Buffer)) {
|
if (!(chunk instanceof Buffer)) {
|
||||||
throw new Error('Unexpected chunk');
|
throw new Error('Unexpected chunk');
|
||||||
}
|
}
|
||||||
@ -101,7 +101,6 @@ export class FileController extends BaseController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.App.get("/download-audio-message/:id", (res: HttpResponse, req: HttpRequest) => {
|
this.App.get("/download-audio-message/:id", (res: HttpResponse, req: HttpRequest) => {
|
||||||
(async () => {
|
|
||||||
this.addCorsHeaders(res);
|
this.addCorsHeaders(res);
|
||||||
|
|
||||||
res.onAborted(() => {
|
res.onAborted(() => {
|
||||||
@ -154,8 +153,6 @@ export class FileController extends BaseController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
})();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ const handleBody = (res: HttpResponse, req: HttpRequest) => {
|
|||||||
|
|
||||||
if (contType.includes('application/json'))
|
if (contType.includes('application/json'))
|
||||||
res.json = async () => JSON.parse(await res.body());
|
res.json = async () => JSON.parse(await res.body());
|
||||||
if (contTypes.map(t => contType.indexOf(t) > -1).indexOf(true) > -1)
|
if (contTypes.map(t => contType.includes(t)).includes(true))
|
||||||
res.formData = formData.bind(res, contType);
|
res.formData = formData.bind(res, contType);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ function formData(
|
|||||||
encoding: string,
|
encoding: string,
|
||||||
mimetype: string
|
mimetype: string
|
||||||
) => string;
|
) => string;
|
||||||
onField?: (fieldname: string, value: any) => void;
|
onField?: (fieldname: string, value: any) => void; // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||||
filename?: (oldName: string) => string;
|
filename?: (oldName: string) => string;
|
||||||
} = {}
|
} = {}
|
||||||
) {
|
) {
|
||||||
@ -75,11 +75,11 @@ function formData(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setRetValue(
|
function setRetValue(
|
||||||
ret: { [x: string]: any },
|
ret: { [x: string]: any }, // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||||
fieldname: string,
|
fieldname: string,
|
||||||
value: { filename: string; encoding: string; mimetype: string; filePath?: string } | any
|
value: { filename: string; encoding: string; mimetype: string; filePath?: string } | any // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||||
) {
|
) {
|
||||||
if (fieldname.slice(-2) === '[]') {
|
if (fieldname.endsWith('[]')) {
|
||||||
fieldname = fieldname.slice(0, fieldname.length - 2);
|
fieldname = fieldname.slice(0, fieldname.length - 2);
|
||||||
if (Array.isArray(ret[fieldname])) {
|
if (Array.isArray(ret[fieldname])) {
|
||||||
ret[fieldname].push(value);
|
ret[fieldname].push(value);
|
||||||
|
@ -48,9 +48,9 @@ async function startOneUser(): Promise<void> {
|
|||||||
connectionManager.initBenchmark();
|
connectionManager.initBenchmark();
|
||||||
|
|
||||||
|
|
||||||
for (let userNo = 0; userNo < 40; userNo++) {
|
for (let userNo = 0; userNo < 160; userNo++) {
|
||||||
startOneUser();
|
startOneUser();
|
||||||
// Wait 0.5s between adding users
|
// Wait 0.5s between adding users
|
||||||
await sleep(500);
|
await sleep(125);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user