Deprecate USR1 signal handling, add USR2 with same semantic

Closes #71
This commit is contained in:
Sandro Santilli 2013-03-18 16:37:31 +01:00
parent 3ff3dc2c97
commit d95ac85b17
3 changed files with 7 additions and 1 deletions

View File

@ -3,6 +3,7 @@
* Handle SQL API errors by requesting no Varnish cache
* Fix X-Cache-Channel for multilayer (by token) responses
* Add last_modified field to POST layergroup response (#72)
* Deprecate signal handler for USR1, add handler for USR2 (#71)
1.1.8
-----

5
app.js
View File

@ -46,6 +46,11 @@ ws.on('listening', function() {
console.log("Windshaft tileserver started on " + global.environment.host + ':' + global.environment.port);
});
// DEPRECATED, use SIGUSR2
process.on('SIGUSR1', function() {
ws.dumpCacheStats();
});
process.on('SIGUSR2', function() {
ws.dumpCacheStats();
});

View File

@ -67,7 +67,7 @@ for pid in ${pids}; do
log=$(grep "${pid}" "${tmpreport}" | grep -w 1w | awk '{print $9}')
if test -e "${log}"; then
kill -USR1 "${pid}"
kill -USR2 "${pid}"
cnt=$(tac ${log} | sed -n -e '/ItemKey/p;/^RenderCache/q' | wc -l)
if test $cnt -gt $maxcache; then maxcache=$cnt; fi
else