mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-06 01:17:52 +00:00
Router: Ensure log gzipper finishes after shutdown signal
This commit is contained in:
@@ -118,13 +118,17 @@ class FileLogWriter extends LogWriter {
|
||||
} catch (IOException ioe) {}
|
||||
}
|
||||
if (_manager.shouldGzip() && currentFile != null && currentFile.length() >= _manager.getMinGzipSize()) {
|
||||
// we always start a non-daemon thread for this,
|
||||
// because the thread we are in now is a daemon thread.
|
||||
Thread gzipper = new Gzipper(currentFile);
|
||||
if (threadGzipper) {
|
||||
// rotate
|
||||
gzipper.setPriority(Thread.MIN_PRIORITY);
|
||||
gzipper.start(); // rotate
|
||||
} else {
|
||||
gzipper.run(); // shutdown
|
||||
// shutdown
|
||||
gzipper.setPriority(Thread.MAX_PRIORITY - 1);
|
||||
}
|
||||
gzipper.start();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user