mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-26 13:26:22 +00:00
docs: fix outdated comment on rebuild debounce behaviour
This commit is contained in:
parent
7cb1c291c8
commit
355aa22318
1 changed files with 3 additions and 4 deletions
|
@ -135,7 +135,6 @@ async function rebuildFromEntrypoint(
|
||||||
toRebuild,
|
toRebuild,
|
||||||
toRemove,
|
toRemove,
|
||||||
trackedAssets,
|
trackedAssets,
|
||||||
lastBuildMs,
|
|
||||||
} = buildData
|
} = buildData
|
||||||
|
|
||||||
const { argv } = ctx
|
const { argv } = ctx
|
||||||
|
@ -164,12 +163,12 @@ async function rebuildFromEntrypoint(
|
||||||
toRemove.add(filePath)
|
toRemove.add(filePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
// debounce rebuilds every 250ms
|
|
||||||
|
|
||||||
const buildStart = new Date().getTime()
|
const buildStart = new Date().getTime()
|
||||||
buildData.lastBuildMs = buildStart
|
buildData.lastBuildMs = buildStart
|
||||||
const release = await mut.acquire()
|
const release = await mut.acquire()
|
||||||
if (lastBuildMs > buildStart) {
|
|
||||||
|
// there's another build after us, release and let them do it
|
||||||
|
if (buildData.lastBuildMs > buildStart) {
|
||||||
release()
|
release()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue