feat(arch): add log partitioning and provider delete sync

This commit is contained in:
zenfun
2025-12-21 20:45:16 +08:00
parent f819f89ba2
commit 816ea93339
23 changed files with 582 additions and 69 deletions

View File

@@ -61,7 +61,7 @@ func (h *MasterHandler) GetSelfStats(c *gin.Context) {
}
logDB := h.logDBConn()
base := logDB.Model(&model.LogRecord{})
base := h.logBaseQuery()
if logDB == h.db {
base = base.Joins("JOIN keys ON keys.id = log_records.key_id").
Where("keys.master_id = ?", m.ID)
@@ -170,7 +170,7 @@ func (h *AdminHandler) GetAdminStats(c *gin.Context) {
}
logDB := h.logDBConn()
base := logDB.Model(&model.LogRecord{})
base := h.logBaseQuery()
base = applyStatsRange(base, rng)
totalRequests, totalTokens, err := aggregateTotals(base)