mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
simpler solution to #257
keeping env.run.finish in case we add more logging at some point
This commit is contained in:
parent
1a7a7f8588
commit
ef6d78f88e
20
jsdoc.js
20
jsdoc.js
@ -423,18 +423,16 @@ function main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try { main(); }
|
try {
|
||||||
|
main();
|
||||||
|
env.run.finish = new Date();
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
if (e.rhinoException != null) {
|
env.run.finish = new Date();
|
||||||
e.rhinoException.printStackTrace();
|
if (e.rhinoException != null) {
|
||||||
} else {
|
e.rhinoException.printStackTrace();
|
||||||
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
|
||||||
env.run.finish = new Date();
|
|
||||||
// on Rhino, we never exit unless we shut down the timer pool
|
|
||||||
if (__timerPool) {
|
|
||||||
__timerPool.shutdownNow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -16,8 +16,6 @@ __dirname = env.dirname;
|
|||||||
* @see https://developer.mozilla.org/en-US/docs/DOM/window#Methods
|
* @see https://developer.mozilla.org/en-US/docs/DOM/window#Methods
|
||||||
*/
|
*/
|
||||||
|
|
||||||
__timerPool = null;
|
|
||||||
|
|
||||||
setTimeout = null,
|
setTimeout = null,
|
||||||
clearTimeout = null,
|
clearTimeout = null,
|
||||||
setInterval = null,
|
setInterval = null,
|
||||||
@ -25,7 +23,7 @@ clearInterval = null;
|
|||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
// TODO: tune number of threads if necessary
|
// TODO: tune number of threads if necessary
|
||||||
__timerPool = new java.util.concurrent.ScheduledThreadPoolExecutor(10);
|
var timerPool = new java.util.concurrent.ScheduledThreadPoolExecutor(10);
|
||||||
var timers = {};
|
var timers = {};
|
||||||
var timerCount = 1;
|
var timerCount = 1;
|
||||||
var timerUnits = java.util.concurrent.TimeUnit.MILLISECONDS;
|
var timerUnits = java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||||
@ -39,13 +37,13 @@ clearInterval = null;
|
|||||||
setTimeout = function(fn, delay) {
|
setTimeout = function(fn, delay) {
|
||||||
var timerId = timerCount++;
|
var timerId = timerCount++;
|
||||||
var callback = getCallback(fn);
|
var callback = getCallback(fn);
|
||||||
timers[timerId] = __timerPool.schedule(callback, delay, timerUnits);
|
timers[timerId] = timerPool.schedule(callback, delay, timerUnits);
|
||||||
return timerId;
|
return timerId;
|
||||||
};
|
};
|
||||||
|
|
||||||
clearTimeout = function(timerId) {
|
clearTimeout = function(timerId) {
|
||||||
if (timers[timerId]) {
|
if (timers[timerId]) {
|
||||||
__timerPool.remove(timers[timerId]);
|
timerPool.remove(timers[timerId]);
|
||||||
delete timers[timerId];
|
delete timers[timerId];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -53,7 +51,7 @@ clearInterval = null;
|
|||||||
setInterval = function(fn, delay) {
|
setInterval = function(fn, delay) {
|
||||||
var timerId = timerCount++;
|
var timerId = timerCount++;
|
||||||
var callback = getCallback(fn);
|
var callback = getCallback(fn);
|
||||||
timers[timerId] = __timerPool.scheduleAtFixedRate(callback, delay, delay, timerUnits);
|
timers[timerId] = timerPool.scheduleAtFixedRate(callback, delay, delay, timerUnits);
|
||||||
return timerId;
|
return timerId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user