Merge branch 'MHSanaei:main' into main

This commit is contained in:
💞M5914H💞 2025-07-12 10:15:02 +03:30 committed by GitHub
commit aa0951cb93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ func (lw *LogWriter) Write(m []byte) (n int, err error) {
if crashRegex.MatchString(message) { if crashRegex.MatchString(message) {
logger.Debug("Core crash detected:\n", message) logger.Debug("Core crash detected:\n", message)
lw.lastLine = message lw.lastLine = message
err1 := writeCrachReport(m) err1 := writeCrashReport(m)
if err1 != nil { if err1 != nil {
logger.Error("Unable to write crash report:", err1) logger.Error("Unable to write crash report:", err1)
} }

View file

@ -242,7 +242,7 @@ func (p *process) Stop() error {
return p.cmd.Process.Signal(syscall.SIGTERM) return p.cmd.Process.Signal(syscall.SIGTERM)
} }
func writeCrachReport(m []byte) error { func writeCrashReport(m []byte) error {
crashReportPath := config.GetBinFolderPath() + "/core_crash_" + time.Now().Format("20060102_150405") + ".log" crashReportPath := config.GetBinFolderPath() + "/core_crash_" + time.Now().Format("20060102_150405") + ".log"
return os.WriteFile(crashReportPath, m, os.ModePerm) return os.WriteFile(crashReportPath, m, os.ModePerm)
} }