Remove double process start on init
This commit is contained in:
8
mod.ts
8
mod.ts
@@ -8,16 +8,14 @@ let appInitTime: number = Date.now();
|
|||||||
let timeout: number|null = null;
|
let timeout: number|null = null;
|
||||||
|
|
||||||
function runApp() {
|
function runApp() {
|
||||||
appInitTime = Date.now();
|
appInitTime = Date.now();
|
||||||
app && app.close();
|
app.close();
|
||||||
app = startProcess(Deno.args);
|
app = startProcess(Deno.args);
|
||||||
}
|
}
|
||||||
|
|
||||||
runApp();
|
|
||||||
|
|
||||||
for await (const event of Deno.watchFs('.')) {
|
for await (const event of Deno.watchFs('.')) {
|
||||||
if (event.kind !== "access") {
|
if (event.kind !== "access") {
|
||||||
if (timeout) clearTimeout(timeout);
|
if (timeout) clearTimeout(timeout);
|
||||||
timeout = setTimeout(runApp, throttle);
|
timeout = setTimeout(runApp, throttle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user