@cloudflare/sandbox 0.6.7 → 0.6.9

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/dist/index.js CHANGED
@@ -2524,7 +2524,7 @@ function resolveS3fsOptions(provider, userOptions) {
2524
2524
  * This file is auto-updated by .github/changeset-version.ts during releases
2525
2525
  * DO NOT EDIT MANUALLY - Changes will be overwritten on the next version bump
2526
2526
  */
2527
- const SDK_VERSION = "0.6.7";
2527
+ const SDK_VERSION = "0.6.9";
2528
2528
 
2529
2529
  //#endregion
2530
2530
  //#region src/sandbox.ts
@@ -2610,6 +2610,7 @@ var Sandbox = class extends Container {
2610
2610
  this.sandboxName = await this.ctx.storage.get("sandboxName") || null;
2611
2611
  this.normalizeId = await this.ctx.storage.get("normalizeId") || false;
2612
2612
  this.defaultSession = await this.ctx.storage.get("defaultSession") || null;
2613
+ this.keepAliveEnabled = await this.ctx.storage.get("keepAliveEnabled") || false;
2613
2614
  const storedTimeouts = await this.ctx.storage.get("containerTimeouts");
2614
2615
  if (storedTimeouts) this.containerTimeouts = {
2615
2616
  ...this.containerTimeouts,
@@ -2633,9 +2634,11 @@ var Sandbox = class extends Container {
2633
2634
  }
2634
2635
  async setSleepAfter(sleepAfter) {
2635
2636
  this.sleepAfter = sleepAfter;
2637
+ this.renewActivityTimeout();
2636
2638
  }
2637
2639
  async setKeepAlive(keepAlive) {
2638
2640
  this.keepAliveEnabled = keepAlive;
2641
+ await this.ctx.storage.put("keepAliveEnabled", keepAlive);
2639
2642
  if (keepAlive) this.logger.info("KeepAlive mode enabled - container will stay alive until explicitly destroyed");
2640
2643
  else this.logger.info("KeepAlive mode disabled - container will timeout normally");
2641
2644
  }