@buka/nestjs-kit 4.1.3 → 4.1.4
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/CHANGELOG.md +7 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3530,7 +3530,8 @@ let OpenBaoTokenManager = _OpenBaoTokenManager = class OpenBaoTokenManager {
|
|
|
3530
3530
|
return;
|
|
3531
3531
|
}
|
|
3532
3532
|
const renewBuffer = this.config.renewBufferSeconds ?? 30;
|
|
3533
|
-
const
|
|
3533
|
+
const maxCheckInterval = Math.min(10080 * 60 * 1e3, this.leaseDuration * .7 * 1e3);
|
|
3534
|
+
const renewInMs = Math.min(Math.max((this.leaseDuration - renewBuffer) * 1e3, 1e3), maxCheckInterval);
|
|
3534
3535
|
this.renewalTimer = setTimeout(() => {
|
|
3535
3536
|
this.renewToken();
|
|
3536
3537
|
}, renewInMs);
|