@techninja/clearstack 0.4.9 → 0.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/watch-runner.js +8 -1
- package/package.json +1 -1
package/lib/watch-runner.js
CHANGED
|
@@ -56,7 +56,13 @@ export function runKeys(specRows, keys, ctx) {
|
|
|
56
56
|
* @param {{ fast: ReturnType<typeof setTimeout>|null, slow: ReturnType<typeof setTimeout>|null }} timers
|
|
57
57
|
* @param {(keys: Set<string>) => void} run
|
|
58
58
|
*/
|
|
59
|
+
let fixing = false;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
*/
|
|
59
64
|
export function schedule(specRows, ctx, pending, timers, run, checksForExt, ext) {
|
|
65
|
+
if (fixing) return;
|
|
60
66
|
for (const k of checksForExt(ext)) {
|
|
61
67
|
const row = specRows.find((r) => r.key === k);
|
|
62
68
|
if (row) row.pass = null;
|
|
@@ -85,6 +91,7 @@ export function setupFix(specRows, cmds, ctx, pending, timers, run) {
|
|
|
85
91
|
pending.slow.add(row.key);
|
|
86
92
|
}
|
|
87
93
|
render(ctx.rows, ctx.lastCheck.value, ctx.watchDirs, ctx.currentViolations.value);
|
|
94
|
+
fixing = true;
|
|
88
95
|
for (const row of fixable) {
|
|
89
96
|
try {
|
|
90
97
|
if (row.fix) row.fix();
|
|
@@ -93,6 +100,6 @@ export function setupFix(specRows, cmds, ctx, pending, timers, run) {
|
|
|
93
100
|
}
|
|
94
101
|
clearTimeout(timers.fast);
|
|
95
102
|
clearTimeout(timers.slow);
|
|
96
|
-
timers.slow = setTimeout(() => { const keys = new Set(pending.slow); pending.slow.clear(); run(keys); }, 2000);
|
|
103
|
+
timers.slow = setTimeout(() => { fixing = false; const keys = new Set(pending.slow); pending.slow.clear(); run(keys); }, 2000);
|
|
97
104
|
});
|
|
98
105
|
}
|