timeout setting. This page sets that limit when the sandbox is created, extends it later, chooses what happens when it expires, and lifts the cap with . The sandbox lifecycle page lists the defaults that apply when timeout is not passed.
Install the SDK, or the CLI for
ppio commands, and set the PPIO_API_KEY and PPIO_DOMAIN environment variables before running these examples. See Quickstart and Install and authenticate.Create a sandbox with a timeout
timeout is not set, the sandbox runs for the SDK default lifetime listed on Sandbox lifecycle and states.
Extend the timeout
setTimeout / set_timeout resets how much longer the sandbox stays alive. The value is in seconds in Python and in milliseconds in Node.js. In the CLI example, <sandbox-id> is the sandbox ID.
Choose what happens at timeout
Combinetimeout with lifecycle to choose whether the sandbox is killed or paused when the timeout expires. If lifecycle is not passed, the sandbox is killed when the timeout expires.
Use long-running mode
By default,timeout is capped by the team’s maximum session duration; see Quotas and limits. Long-running mode lifts the cap, so the timeout passed at creation can exceed it. The setting is a metadata key named long_running with the string value "true". Sandbox lifecycle and states covers how the setting is inherited by resume, clone, and reset.