fixes organization key issue (via Drago/oai-reverse-proxy@714292ed)

This commit is contained in:
nai-degen 2023-08-29 04:13:12 -05:00
parent 09416c0b90
commit bb78a399eb
2 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ export class AnthropicKeyProvider implements KeyProvider<AnthropicKey> {
}
public disable(key: AnthropicKey) {
const keyFromPool = this.keys.find((k) => k.key === key.key);
const keyFromPool = this.keys.find((k) => k.hash === key.hash);
if (!keyFromPool || keyFromPool.isDisabled) return;
keyFromPool.isDisabled = true;
this.log.warn({ key: key.hash }, "Key disabled");

View File

@ -224,7 +224,7 @@ export class OpenAIKeyProvider implements KeyProvider<OpenAIKey> {
/** Disables a key, or does nothing if the key isn't in this pool. */
public disable(key: Key) {
const keyFromPool = this.keys.find((k) => k.key === key.key);
const keyFromPool = this.keys.find((k) => k.hash === key.hash);
if (!keyFromPool || keyFromPool.isDisabled) return;
keyFromPool.isDisabled = true;
this.log.warn({ key: key.hash }, "Key disabled");