fixes organization key issue (via Drago/oai-reverse-proxy@714292ed)
This commit is contained in:
parent
09416c0b90
commit
bb78a399eb
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue