tiny refactor in Ghosts

This commit is contained in:
Andre Staltz 2024-03-01 14:56:44 +02:00
parent 6661b73fd4
commit cf1532965e
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
1 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ class Ghosts {
// neither fully parallel
if (FS.existsSync(basePath)) {
const done = multicb({ pluck: 1 })
FS.readdirSync(basePath).forEach((tangleID) => {
for (const tangleID of FS.readdirSync(basePath)) {
const cb = done()
this.#read(tangleID, (err, map) => {
// prettier-ignore
@ -60,7 +60,7 @@ class Ghosts {
this.#maps.set(tangleID, map)
cb()
})
})
}
done((err, _) => {
// prettier-ignore
if (err) throw new Error('GhostDB failed to load', { cause: err })