feat: sync deployed v1.0.0-rc.38-custom.42
Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
This commit is contained in:
1 parent
aa6c3f50f4
commit
ceddfd3d6b
828 files changed
+122253
-13702
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package model
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// Correct historical error-log presentation from the already-stored routing
|
||||
// evidence, without rewriting financial history or exposing private metadata.
|
||||
// Consume records always retain their original billed group.
|
||||
func normalizeErrorLogGroup(log *Log) {
|
||||
if log == nil || log.Type != LogTypeError {
|
||||
return
|
||||
}
|
||||
if log.ChannelId <= 0 {
|
||||
log.Group = ""
|
||||
return
|
||||
}
|
||||
var other struct {
|
||||
Admin struct {
|
||||
Events []struct {
|
||||
ChannelID int `json:"channel_id"`
|
||||
Group string `json:"group"`
|
||||
} `json:"request_policy"`
|
||||
} `json:"admin_info"`
|
||||
}
|
||||
if json.Unmarshal([]byte(log.Other), &other) != nil {
|
||||
return
|
||||
}
|
||||
for i := len(other.Admin.Events) - 1; i >= 0; i-- {
|
||||
event := other.Admin.Events[i]
|
||||
if event.ChannelID == log.ChannelId && event.Group != "" && event.Group != "auto" {
|
||||
log.Group = event.Group
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user