refactor: Load LRU first.

This commit is contained in:
Hayden Young 2023-03-07 11:38:34 +00:00
parent 93366f0b8c
commit 113d954b42

View File

@ -84,7 +84,7 @@ const defaultPath = './keystore'
* @return {KeyStore} An instance of KeyStore.
*/
const KeyStore = async ({ storage, path } = {}) => {
storage = storage || await ComposedStorage(await LevelStorage({ path: path || defaultPath }), await LRUStorage({ size: 1000 }))
storage = storage || await ComposedStorage(await LRUStorage({ size: 1000 }), await LevelStorage({ path: path || defaultPath }))
const close = async () => {
await storage.close()