used the search to make sure that a similar issue hasn't already been submit
Versions:
"@types/node": "^20.10.7",
"ts-node": "^9.0.0"
"typescript": "^5.3.3"
"tsoa": "^3.2.1",
Issue Description:
I am experiencing a 5-6 second delay between the execution of the @security decorator and the main API logic, but only when the application is deployed (on azure app service). This issue does not occur locally.
Steps to Reproduce:
I consoled the time at each step from the authentication middleware to the API response.
I have 3 securities in the @security decorator, so the authentication middleware is called 3 times.
The authentication middleware combined execution takes only 1 second.
There is a gap of 4-5 seconds between the last console log in the authentication middleware and the first console log in the API logic.
export async function expressAuthentication(request: IRequest, securityName: string, scopes?: string[]): Promise<any> {
try {
console.log(`Authentication middleware Start - ${new Date()}`);
if (securityName === "security1") {
// security1 logic
} else if (securityName === "security2") {
// security2 logic
} else if (securityName === "security3") {
// security3 logic
} else {
// other logic
}
console.log(`Authentication middleware End - ${new Date()}`);
} catch (error) {
throw new MyError(error);
}
}
Request for Help:
Can anyone help me understand why there is such a gap and how I can fix it? Any insights or suggestions would be greatly appreciated.
Sorting
I'm submitting a ...
I confirm that I
Versions:
Issue Description: I am experiencing a 5-6 second delay between the execution of the @security decorator and the main API logic, but only when the application is deployed (on azure app service). This issue does not occur locally.
Steps to Reproduce:
API Logic:
Authentication Middleware:
Request for Help: Can anyone help me understand why there is such a gap and how I can fix it? Any insights or suggestions would be greatly appreciated.
Thank you!