correctly flags trial keys during startup even if over quota
This commit is contained in:
parent
aa5380d2ef
commit
77c2309b52
|
@ -202,6 +202,12 @@ export class OpenAIKeyChecker {
|
|||
GET_SUBSCRIPTION_URL,
|
||||
{ headers: { Authorization: `Bearer ${key.key}` } }
|
||||
);
|
||||
// See note above about updating the key's `lastChecked` timestamp.
|
||||
const keyFromPool = this.keys.find((k) => k.hash === key.hash)!;
|
||||
this.updateKey(key.hash, {
|
||||
isTrial: !data.has_payment_method,
|
||||
lastChecked: keyFromPool.lastChecked,
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue