Skip to content

Commit

Permalink
only report tasklogger is running if both stdout and stderr are still…
Browse files Browse the repository at this point in the history
… running
  • Loading branch information
drewbailey committed Jun 12, 2020
1 parent ef67b1b commit 42658b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 3 additions & 7 deletions client/logmon/logmon.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,10 @@ type TaskLogger struct {

// IsRunning will return true as long as one rotator wrapper is still running
func (tl *TaskLogger) IsRunning() bool {
if tl.lro != nil && tl.lro.isRunning() {
return true
}
if tl.lre != nil && tl.lre.isRunning() {
return true
}
lroRunning := tl.lro != nil && tl.lro.isRunning()
lreRunning := tl.lre != nil && tl.lre.isRunning()

return false
return lroRunning && lreRunning
}

func (tl *TaskLogger) Close() {
Expand Down
1 change: 0 additions & 1 deletion client/logmon/logmon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ func TestLogmon_Start_restart(t *testing.T) {
require.True(impl.tl.IsRunning())

// Close stdout and assert that logmon no longer writes to the file
require.NoError(stdout.Close())
require.NoError(stderr.Close())

testutil.WaitForResult(func() (bool, error) {
Expand Down

0 comments on commit 42658b7

Please sign in to comment.