(files)
| 54 | }; |
| 55 | |
| 56 | function queueSync(files) { |
| 57 | queuedFiles = files; |
| 58 | if (syncRunning) return; |
| 59 | |
| 60 | syncRunning = true; |
| 61 | runQueuedSync() |
| 62 | .catch((error) => { |
| 63 | postStatus({ |
| 64 | state: "error", |
| 65 | message: error?.message || "Search index unavailable", |
| 66 | }); |
| 67 | }) |
| 68 | .finally(() => { |
| 69 | syncRunning = false; |
| 70 | }); |
| 71 | } |
| 72 | |
| 73 | async function runQueuedSync() { |
| 74 | while (queuedFiles) { |
no test coverage detected