For example, the following is an async function:
async function encryptPwd() {
const salt = await bcrypt.genSalt(5);
const encryptedPwd = await bcrypt.hash(password, salt);
return encryptedPwd;
}
If the server is lagging a lot, I want to abort this activity and return an error. How can I set a timeout for like 10 sec (for example)?