fix(controller): include session ID in analysis error log

style(log): use octal notation for file permissions
This commit is contained in:
2026-01-11 04:00:52 +08:00
parent ac5bdad507
commit 4eb4b202c5
3 changed files with 6 additions and 3 deletions

View File

@@ -111,7 +111,7 @@ type RotateFileWriter struct {
func (w *RotateFileWriter) openFile() error {
var err error
w.file, err = os.OpenFile(w.filePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
w.file, err = os.OpenFile(w.filePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o644)
return err
}
@@ -129,7 +129,9 @@ func (w *RotateFileWriter) checkRotate() error {
oldPath := w.filePath
newPath := w.filePath + "." + w.currentDate
if _, err := os.Stat(oldPath); err == nil {
os.Rename(oldPath, newPath)
if err := os.Rename(oldPath, newPath); err != nil {
return err
}
}
// Clean up old log files