From 8a6ebd193933c2879c2a36e1b2f164889575d3bc Mon Sep 17 00:00:00 2001
From: Justin Fowler <justin.fowler@hey.com>
Date: Fri, 02 Feb 2024 04:17:21 +0000
Subject: [PATCH] docs: clarity for `RecentNotes` (#786)

---
 quartz/build.ts |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/quartz/build.ts b/quartz/build.ts
index b78ff2b..1f90301 100644
--- a/quartz/build.ts
+++ b/quartz/build.ts
@@ -126,17 +126,8 @@
   clientRefresh: () => void,
   buildData: BuildData, // note: this function mutates buildData
 ) {
-  const {
-    ctx,
-    ignored,
-    mut,
-    initialSlugs,
-    contentMap,
-    toRebuild,
-    toRemove,
-    trackedAssets,
-    lastBuildMs,
-  } = buildData
+  const { ctx, ignored, mut, initialSlugs, contentMap, toRebuild, toRemove, trackedAssets } =
+    buildData
 
   const { argv } = ctx
 
@@ -164,12 +155,12 @@
     toRemove.add(filePath)
   }
 
-  // debounce rebuilds every 250ms
-
   const buildStart = new Date().getTime()
   buildData.lastBuildMs = buildStart
   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()
     return
   }

--
Gitblit v1.10.0