diff --git a/local/pid/pidfile.go b/local/pid/pidfile.go index b044c8a0..54dbd86d 100644 --- a/local/pid/pidfile.go +++ b/local/pid/pidfile.go @@ -305,6 +305,11 @@ func AllWorkers(dir string) []*PidFile { // Remove a pidfile func (p *PidFile) Remove() error { for _, file := range []string{p.LogFile(), p.PidFile()} { + // Ensure log writer is closed first to avoid "file is being used" on Windows + if p.lw != nil { + _ = p.lw.Close() + p.lw = nil + } if err := os.Remove(file); err != nil && !os.IsNotExist(err) { return errors.WithStack(err) } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy