maxpool 1.24.88 → 1.24.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/account-manager.js +14 -0
package/package.json
CHANGED
package/src/account-manager.js
CHANGED
|
@@ -1879,6 +1879,17 @@ export class AccountManager {
|
|
|
1879
1879
|
return !sourceDying;
|
|
1880
1880
|
}
|
|
1881
1881
|
|
|
1882
|
+
/** C3: a listing failure holds an active lift LIFT_GRACE_MS from the FIRST failure
|
|
1883
|
+
* of the streak — measured from the last good read, a failure late in the 5-min
|
|
1884
|
+
* cycle left ~3 min of hold (live 2026-11-11). A good listing rewrites capLift,
|
|
1885
|
+
* which ends the streak. */
|
|
1886
|
+
_holdLiftThroughFailure(account, now = Date.now()) {
|
|
1887
|
+
const st = account.capLift;
|
|
1888
|
+
if (!st?.active || st.failingSince != null) return;
|
|
1889
|
+
st.failingSince = now;
|
|
1890
|
+
st.graceUntil = Math.max(st.graceUntil ?? 0, now + LIFT_GRACE_MS);
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1882
1893
|
/** True while the account's usage cap is suspended by a held full-refill reset. */
|
|
1883
1894
|
capLiftActive(account, now = Date.now()) {
|
|
1884
1895
|
if (!account || account.enabled === false) return false;
|
|
@@ -4420,6 +4431,7 @@ export class AccountManager {
|
|
|
4420
4431
|
if (account.resetGrants) {
|
|
4421
4432
|
account.resetGrants = { ...account.resetGrants, stale: true, lastError: String(listing.error), lastErrorAt: now };
|
|
4422
4433
|
}
|
|
4434
|
+
this._holdLiftThroughFailure(account, now);
|
|
4423
4435
|
return;
|
|
4424
4436
|
}
|
|
4425
4437
|
account.resetGrants = {
|
|
@@ -4478,6 +4490,7 @@ export class AccountManager {
|
|
|
4478
4490
|
if (account.resetCards) {
|
|
4479
4491
|
account.resetCards = { ...account.resetCards, stale: true, lastError: String(cards.error), lastErrorAt: Date.now() };
|
|
4480
4492
|
}
|
|
4493
|
+
this._holdLiftThroughFailure(account);
|
|
4481
4494
|
return;
|
|
4482
4495
|
}
|
|
4483
4496
|
// DRIFT = a 200 the parser can't have meant (pre-mortem #17): expected arrays
|
|
@@ -4490,6 +4503,7 @@ export class AccountManager {
|
|
|
4490
4503
|
if (account.resetCards) {
|
|
4491
4504
|
account.resetCards = { ...account.resetCards, stale: true, lastError: 'listing drift (unexpected payload shape)', lastErrorAt: Date.now() };
|
|
4492
4505
|
}
|
|
4506
|
+
this._holdLiftThroughFailure(account);
|
|
4493
4507
|
return;
|
|
4494
4508
|
}
|
|
4495
4509
|
account.resetCards = {
|