Fix: logx with Compress auto delete old logs (#3329)

Co-authored-by: haoran.ren <haoran.ren@mihoyo.com>
master
Ron_haur 1 year ago committed by GitHub
parent fd84b27bdc
commit da81d8f774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -426,7 +426,6 @@ func gzipFile(file string) error {
if err != nil {
return err
}
defer in.Close()
out, err := os.Create(fmt.Sprintf("%s%s", file, gzipExt))
if err != nil {
@ -441,5 +440,7 @@ func gzipFile(file string) error {
return err
}
in.Close()
return os.Remove(file)
}

Loading…
Cancel
Save