feat(service): add provider metadata tracking

Write 'meta:providers_meta' to Redis during provider synchronization,
including version, timestamp, and configuration checksum. This aligns
provider sync with model metadata handling and enables better cache
invalidation.
This commit is contained in:
zenfun
2026-01-07 13:42:25 +08:00
parent c19c26817d
commit e35e801839
2 changed files with 43 additions and 8 deletions

View File

@@ -61,6 +61,16 @@ func TestSyncProviders_WritesSnapshot(t *testing.T) {
if snap["group"] != "default" {
t.Fatalf("expected group default, got %#v", snap["group"])
}
if v := mr.HGet("meta:providers_meta", "version"); v == "" {
t.Fatalf("expected meta:providers_meta.version")
}
if v := mr.HGet("meta:providers_meta", "updated_at"); v == "" {
t.Fatalf("expected meta:providers_meta.updated_at")
}
if v := mr.HGet("meta:providers_meta", "checksum"); v == "" {
t.Fatalf("expected meta:providers_meta.checksum")
}
}
func TestSyncKey_WritesTokenID(t *testing.T) {