Replace promise.all with for loop for performance reasons (#7582)
This commit is contained in:
parent
c4f19bdc6e
commit
842fa5153b
|
@ -155,7 +155,12 @@ export class EncryptServiceImplementation implements EncryptService {
|
|||
return [];
|
||||
}
|
||||
|
||||
return await Promise.all(items.map((item) => item.decrypt(key)));
|
||||
// don't use promise.all because this task is not io bound
|
||||
let results = [];
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
results.push(await items[i].decrypt(key));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
async hash(value: string | Uint8Array, algorithm: "sha1" | "sha256" | "sha512"): Promise<string> {
|
||||
|
|
Loading…
Reference in New Issue