()
| 1657 | }; |
| 1658 | |
| 1659 | const flush = async () => { |
| 1660 | flushTimer = null; |
| 1661 | |
| 1662 | // A previous batch is still running — retry shortly so we never run |
| 1663 | // two passes concurrently. |
| 1664 | if (flushing) { |
| 1665 | flushTimer = setTimeout(flush, 50); |
| 1666 | |
| 1667 | return; |
| 1668 | } |
| 1669 | |
| 1670 | flushing = true; |
| 1671 | |
| 1672 | const batch = [...pending.entries()]; |
| 1673 | |
| 1674 | pending.clear(); |
| 1675 | |
| 1676 | for (const [absPath, type] of batch) { |
| 1677 | try { |
| 1678 | await handleChange(absPath, type); |
| 1679 | } catch (err) { |
| 1680 | logger.warn(`framework-loader: failed to reload ${absPath}: ${err.message}`); |
| 1681 | } |
| 1682 | } |
| 1683 | |
| 1684 | flushing = false; |
| 1685 | |
| 1686 | if (pending.size > 0) { |
| 1687 | flushTimer = setTimeout(flush, 50); |
| 1688 | } |
| 1689 | }; |
| 1690 | |
| 1691 | const queueChange = type => (changedPath) => { |
| 1692 | if (!changedPath.startsWith(watchRoot)) return; |
nothing calls this directly
no test coverage detected
searching dependent graphs…