Comparing version 0.1.1 to 0.1.2
@@ -12,3 +12,3 @@ var chokidar, http, path, uncache; | ||
module.exports = (program) => { | ||
var busy, close, connections, entry, ref, restart, server, startup, unwatchedModules, watcher; | ||
var busy, clearUnbusyTimeout, close, connections, entry, ref, restart, server, startup, unbusyTimeout, unwatchedModules, watcher; | ||
if (((ref = program.args) != null ? ref[0] : void 0) == null) { | ||
@@ -31,2 +31,9 @@ return; | ||
busy = false; | ||
unbusyTimeout = null; | ||
clearUnbusyTimeout = () => { | ||
if (unbusyTimeout != null) { | ||
clearTimeout(unbusyTimeout); | ||
return unbusyTimeout = null; | ||
} | ||
}; | ||
unwatchedModules = []; | ||
@@ -75,3 +82,2 @@ connections = []; | ||
}).on("all", (e, filepath) => { | ||
var resetTimeout; | ||
if (busy) { | ||
@@ -84,3 +90,3 @@ if (busy !== true) { | ||
uncache(filepath, __filename); | ||
busy = resetTimeout = () => { | ||
busy = () => { | ||
if (busy.timeoutObj != null) { | ||
@@ -97,3 +103,4 @@ clearTimeout(busy.timeoutObj); | ||
} | ||
return busy = false; | ||
busy = false; | ||
return clearUnbusyTimeout(); | ||
}; | ||
@@ -103,6 +110,11 @@ startup(false); | ||
var con, i, len, promise; | ||
if (busy) { | ||
if (busy === true) { | ||
return; | ||
} | ||
busy = true; | ||
clearUnbusyTimeout(); | ||
unbusyTimeout = setTimeout((() => { | ||
console.log("autodev: startup timed out"); | ||
return busy = false; | ||
}), 3000); | ||
console.log("autodev: tearing down\n"); | ||
@@ -109,0 +121,0 @@ promise = new Promise(async(resolve) => { |
{ | ||
"name": "autodev", | ||
"description": "quick auto restart script for dev servers", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"homepage": "https://github.com/paulpflug/", | ||
@@ -6,0 +6,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5882
150