mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-07-04 12:03:43 +02:00
src/main.go: in setLogFile() check for null when closing old FD and also check error from Close()
This commit is contained in:
parent
2470062c3d
commit
8be4466d66
1 changed files with 5 additions and 3 deletions
|
|
@ -54,9 +54,11 @@ func setLogFile() {
|
||||||
log.Error(err.Error())
|
log.Error(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close old one (if open)
|
// Try close if old descriptor is defined.
|
||||||
if logfd.Fd() < 0 {
|
if logfd != nil {
|
||||||
logfd.Close()
|
if err = logfd.Close(); err != nil {
|
||||||
|
log.Error(err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update variable and set log writer.
|
// Update variable and set log writer.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue