Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,13 @@ private Object readResolve() {
@Override
public OutputStream decorateLogger(@SuppressWarnings("rawtypes") Run build, final OutputStream logger)
throws IOException, InterruptedException {
// TODO if channel == null, we can safely ResetTimer.call synchronously from eol and skip the Tick
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was from #74 FTR

AtomicBoolean active = new AtomicBoolean();
OutputStream decorated = new LineTransformationOutputStream() {
@Override
protected void eol(byte[] b, int len) throws IOException {
if (channel == null) {
new ResetTimer(id).call();
}
logger.write(b, 0, len);
active.set(true);
}
Expand All @@ -357,7 +359,9 @@ public void close() throws IOException {
logger.close();
}
};
new Tick(active, new WeakReference<>(decorated), timeout, channel, id).schedule();
if (channel != null) {
new Tick(active, new WeakReference<>(decorated), timeout, channel, id).schedule();
}
return decorated;
}
}
Expand Down