Closed im-calvin closed 7 months ago
Thanks @im-calvin for your PR. How keepAlive
works can be little confusing. Actually it's not cumulative, it just takes maximum of current time to live and the required duration.
What can make it confusing is how we internally handle inactive sandboxes. The SDK sends ping every 5 seconds, if API receive the ping it won't kill the sandbox for next 15 seconds (it's like health check and if it's missing 3 times, the sandboxed is considered abandoned).
Question then, on the docs it says that there is a maximum sandbox limit of 1 hours. Is that just for the keepAlive function call or is that an internal limit imposed by you guys
For example, if I call keepAlive 3 times does that make my sandbox live for a total of three hours or just one?
It's internal, sandbox lifetime can't exceed the maximum. If you call to extend the lifetime for another hour and the sandbox is already alive for 30 minutes. It will cap it to the maximum, aka extend the lifetime just by 30 minutes.
Cool thanks for clarifying saves me writing a test to figure that out myself. Is there any way of implementing that feature that I just outlined?
⚠️ No Changeset found
Latest commit: 38baa6fb3321e6dcb26f482bcd67fa945a809eaf
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver typesClick here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR