mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
Add sequentialize to prevent parralel loading of cipher keys (#7)
* Add sequentialize to prevent parralel loading of cipher keys Massively improves start up performance of extensions * Add tests for sequentialize * Fix sequentialize as it was caching calls for all instances together * Add sequentialize to the functions that have internal caches * Adding sequentialize to getOrgKeys makes big performance difference * Update cipher.service.ts * Update collection.service.ts * Update folder.service.ts
This commit is contained in:
@@ -11,6 +11,7 @@ import { StorageService } from '../abstractions/storage.service';
|
||||
|
||||
import { ConstantsService } from './constants.service';
|
||||
|
||||
import { sequentialize } from '../misc/sequentialize';
|
||||
import { Utils } from '../misc/utils';
|
||||
|
||||
const Keys = {
|
||||
@@ -164,6 +165,7 @@ export class CryptoService implements CryptoServiceAbstraction {
|
||||
return this.privateKey;
|
||||
}
|
||||
|
||||
@sequentialize()
|
||||
async getOrgKeys(): Promise<Map<string, SymmetricCryptoKey>> {
|
||||
if (this.orgKeys != null && this.orgKeys.size > 0) {
|
||||
return this.orgKeys;
|
||||
|
||||
Reference in New Issue
Block a user