so-far updates

This commit is contained in:
Alireza Ahmadi
2025-07-30 16:09:15 +02:00
parent ee03836eeb
commit e954ccd957
26 changed files with 806 additions and 403 deletions

View File

@@ -20,6 +20,7 @@ type Config struct {
FakeDNS json_util.RawMessage `json:"fakedns"`
Observatory json_util.RawMessage `json:"observatory"`
BurstObservatory json_util.RawMessage `json:"burstObservatory"`
Metrics json_util.RawMessage `json:"metrics"`
}
func (c *Config) Equals(other *Config) bool {
@@ -61,5 +62,8 @@ func (c *Config) Equals(other *Config) bool {
if !bytes.Equal(c.FakeDNS, other.FakeDNS) {
return false
}
if !bytes.Equal(c.Metrics, other.Metrics) {
return false
}
return true
}

View File

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

View File

@@ -192,7 +192,7 @@ func (p *process) Stop() error {
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"
return os.WriteFile(crashReportPath, m, os.ModePerm)
}