Skip to content

Commit 9e2fc5f

Browse files
committed
skip err log on os.IsNotExist
1 parent f2be50f commit 9e2fc5f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎base/server.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ func (s *Server) handlePProf(msg chat1.MsgSummary) error {
345345
// Cleanup after the file is sent.
346346
time.Sleep(time.Minute)
347347
s.Debug("cleaning up %s", outfile)
348-
if err = os.Remove(outfile); err != nil {
348+
if err = os.Remove(outfile); err != nil && !os.IsNotExist(err) {
349349
s.Errorf("unable to clean up %s: %v", outfile, err)
350350
}
351351
}()

‎webhookbot/webhookbot/http.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (h *HTTPSrv) handleHook(w http.ResponseWriter, r *http.Request) {
100100
// Cleanup after the file is sent.
101101
time.Sleep(time.Minute)
102102
h.Debug("cleaning up %s", filePath)
103-
if err = os.Remove(filePath); err != nil {
103+
if err = os.Remove(filePath); err != nil && !os.IsNotExist(err) {
104104
h.Errorf("unable to clean up %s: %v", filePath, err)
105105
}
106106
}()

0 commit comments

Comments
 (0)