Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Decrease the keep alive period in docs

Jakub Novak59cb86605657
diff --git a/apps/docs/src/code/js/reconnect/reconnect.js b/apps/docs/src/code/js/reconnect/reconnect.js
index 5c0ef3169..22fff2dcb 100644
--- a/apps/docs/src/code/js/reconnect/reconnect.js
+++ b/apps/docs/src/code/js/reconnect/reconnect.js
@@ -12,8 +12,8 @@ await sandbox.filesystem.write('hello.txt', 'Hello World!')
// Get the sandbox ID, we'll need it later
const sandboxID = sandbox.id
-// Keep alive the sandbox for 1 hour
-await sandbox.keepAlive(60 * 60 * 1000) // 1 hour $HighlightLine
+// Keep alive the sandbox for 2 minutes
+await sandbox.keepAlive(2 * 60 * 1000) // 2 * minutes $HighlightLine
// Close the sandbox
await sandbox.close()
diff --git a/apps/docs/src/code/js/reconnect/reconnect_2.js b/apps/docs/src/code/js/reconnect/reconnect_2.js
index e719f7a82..104ecd2d9 100644
--- a/apps/docs/src/code/js/reconnect/reconnect_2.js
+++ b/apps/docs/src/code/js/reconnect/reconnect_2.js
@@ -4,8 +4,8 @@ await sandbox.filesystem.write('hello.txt', 'Hello World!')
// Get the sandbox ID, we'll need it later
const sandboxID = sandbox.id
-// Keep alive the sandbox for 1 hour
-await sandbox.keepAlive(60 * 60 * 1000) // 1 hour $HighlightLine
+// Keep alive the sandbox for 2 minutes
+await sandbox.keepAlive(2 * 60 * 1000) // 2 minutes $HighlightLine
// Close the sandbox. Even if we close the sandbox, it will stay alive, because we explicitly called keepAlive().
await sandbox.close()
diff --git a/apps/docs/src/code/python/reconnect/reconnect.py b/apps/docs/src/code/python/reconnect/reconnect.py
index 6c6550f51..4c9dbe77a 100644
--- a/apps/docs/src/code/python/reconnect/reconnect.py
+++ b/apps/docs/src/code/python/reconnect/reconnect.py
@@ -10,8 +10,8 @@ sandbox.filesystem.write('hello.txt', 'Hello World!')
# Get the sandbox ID, we'll need it later
sandboxID = sandbox.id
-# Keep alive the sandbox for 1 hour
-sandbox.keep_alive(60 * 60) # $HighlightLine
+# Keep alive the sandbox for 2 minutes
+sandbox.keep_alive(2 * 60) # $HighlightLine
# Close the sandbox
sandbox.close()
diff --git a/apps/docs/src/code/python/reconnect/reconnect_2.py b/apps/docs/src/code/python/reconnect/reconnect_2.py
index 5e057f13a..e3ba516a3 100644
--- a/apps/docs/src/code/python/reconnect/reconnect_2.py
+++ b/apps/docs/src/code/python/reconnect/reconnect_2.py
@@ -4,7 +4,7 @@ sandbox.filesystem.write('hello.txt', 'Hello World!')
# Get the sandbox ID, we'll need it later
sandboxID = sandbox.id
-# Keep the sandbox alive for 1 hour
+# Keep the sandbox alive for 2 minutes
sandbox.keep_alive(60 * 60) # $HighlightLine
# Close the sandbox. Even if we close the sandbox, it will stay alive, because we explicitly called keep_alive().