refactor(api): 删掉没有调用方的 QuotaAvailable,修正 passkey last_used_at 的过时注释

This commit is contained in:
Lemon-miaow committed 2026-09-27 14:20:20 +08:00
1 parent 4839d52f88
commit 56a4bbcf4c
5 files changed
+9 -45

No files matched your search

-6
View File
@@ -605,9 +605,6 @@ func TestSetQuotasReplacesEveryCap(t *testing.T) {
set(api.QuotaInput{MaxServers: n(0), MaxCPUMilli: n(2000), MaxMemoryMB: n(4096), MaxStorageGB: n(20)}, "0/2000/4096/20")
gate(false)
if ok, err := repo.QuotaAvailable(ctx, u.ID); err != nil || ok {
t.Fatalf("QuotaAvailable at max_servers 0 = %v, %v; want false", ok, err)
}
if _, err := repo.ClaimServer(ctx, name, u.ID); !errors.Is(err, api.ErrQuotaExceeded) {
t.Fatalf("claim at max_servers 0 = %v, want ErrQuotaExceeded", err)
}
@@ -618,9 +615,6 @@ func TestSetQuotasReplacesEveryCap(t *testing.T) {
gate(false)
set(api.QuotaInput{}, "-/-/-/-")
gate(true)
if ok, err := repo.QuotaAvailable(ctx, u.ID); err != nil || !ok {
t.Fatalf("QuotaAvailable with every cap lifted = %v, %v; want true", ok, err)
}
if claimed, err := repo.ClaimServer(ctx, name, u.ID); err != nil || !claimed {
t.Fatalf("claim with every cap lifted = %v, %v; want claimed", claimed, err)
}