mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
so-far updates
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user