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

@@ -86,10 +86,12 @@ func (h *Handler) DeleteProvider(c *gin.Context) {
return
}
// Full sync is the simplest safe option because provider deletion needs to remove
// stale entries in Redis snapshots (config:providers) and refresh bindings.
if err := h.sync.SyncAll(h.db); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to sync snapshots", "details": err.Error()})
if err := h.sync.SyncProviderDelete(&p); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to sync provider delete", "details": err.Error()})
return
}
if err := h.sync.SyncBindings(h.db); err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to sync bindings", "details": err.Error()})
return
}