We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 696e6ad + 22f087c commit cf28203Copy full SHA for cf28203
backend/src/lib/database-migrations.ts
@@ -637,14 +637,16 @@ COMMENT ON COLUMN subscriptions.status_changed_by IS 'Existing subscriptions mig
637
export const backfillLiteLLMKeyAlias = async (dbUtils: DatabaseUtils, liteLLMService: any) => {
638
try {
639
// Find all API keys that don't have litellm_key_alias set
640
+ // Only process active keys to avoid 404s from inactive/revoked keys
641
const keysToBackfill = await dbUtils.queryMany<{
642
id: string;
643
lite_llm_key_value: string;
644
}>(
645
`SELECT id, lite_llm_key_value
646
FROM api_keys
647
WHERE litellm_key_alias IS NULL
- AND lite_llm_key_value IS NOT NULL`,
648
+ AND lite_llm_key_value IS NOT NULL
649
+ AND is_active = true`,
650
[],
651
);
652
0 commit comments