Remove double process start on init

This commit is contained in:
Michael Roth
2020-05-12 00:00:37 +02:00
committed by GitHub
parent ce3a42a4d7
commit 6219528dcb

8
mod.ts
View File

@@ -8,16 +8,14 @@ let appInitTime: number = Date.now();
let timeout: number|null = null;
function runApp() {
appInitTime = Date.now();
app && app.close();
appInitTime = Date.now();
app.close();
app = startProcess(Deno.args);
}
runApp();
for await (const event of Deno.watchFs('.')) {
if (event.kind !== "access") {
if (timeout) clearTimeout(timeout);
timeout = setTimeout(runApp, throttle);
}
}
}