mirror of https://codeberg.org/pzp/pzp-db.git
tiny refactor in Ghosts
This commit is contained in:
parent
6661b73fd4
commit
cf1532965e
|
@ -52,7 +52,7 @@ class Ghosts {
|
||||||
// neither fully parallel
|
// neither fully parallel
|
||||||
if (FS.existsSync(basePath)) {
|
if (FS.existsSync(basePath)) {
|
||||||
const done = multicb({ pluck: 1 })
|
const done = multicb({ pluck: 1 })
|
||||||
FS.readdirSync(basePath).forEach((tangleID) => {
|
for (const tangleID of FS.readdirSync(basePath)) {
|
||||||
const cb = done()
|
const cb = done()
|
||||||
this.#read(tangleID, (err, map) => {
|
this.#read(tangleID, (err, map) => {
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
|
@ -60,7 +60,7 @@ class Ghosts {
|
||||||
this.#maps.set(tangleID, map)
|
this.#maps.set(tangleID, map)
|
||||||
cb()
|
cb()
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
done((err, _) => {
|
done((err, _) => {
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
if (err) throw new Error('GhostDB failed to load', { cause: err })
|
if (err) throw new Error('GhostDB failed to load', { cause: err })
|
||||||
|
|
Loading…
Reference in New Issue