> ## Documentation Index
> Fetch the complete documentation index at: https://novita.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Veraltetes automatisches Pausieren und Fortsetzen

export const SandboxBetaVersionWarning = () => {
  if (typeof document === "undefined") {
    return null;
  } else {
    return <Warning>The following legacy features require the legacy SDK and CLI versions listed in <Link href="/docs/de/guides/sandbox-legacy-e2b-compatible" target="self">Legacy SDKs & CLI</Link>. Please note that legacy features may be less stable than production releases. If you encounter any issues while using these features, please <Link href="https://meetings-na2.hubspot.com/junyu" target="_blank">contact us</Link>.</Warning>;
  }
};

<Warning>
  Diese veraltete Seite wird für Benutzer beibehalten, die noch die 1.x- oder Beta-SDK-Reihe verwenden. Neue Integrationen mit SDK 2.x sollten der aktuellen Sandbox-Dokumentation folgen.
</Warning>

<SandboxBetaVersionWarning />

Wenn die Sandbox-Instanz derzeit nicht benötigt wird, Sie sie aber später jederzeit fortsetzen können müssen, können Sie die [Dokumentation](/docs/de/guides/sandbox-legacy-persistence) verwenden, um Sandbox-Instanzen manuell zu pausieren und fortzusetzen.

Die Funktion **„Automatisches Pausieren und Fortsetzen“** ermöglicht es Ihrer Sandbox-Instanz, nach einem [Timeout](/docs/de/guides/sandbox-lifecycle) automatisch zu pausieren und bei Bedarf fortgesetzt zu werden. Wenn Sie versuchen, Vorgänge (wie das Ausführen von Befehlen, das Ausführen von Code oder Dateioperationen) in einer pausierten Sandbox durchzuführen, wird sie automatisch ohne manuelles Eingreifen fortgesetzt.

## Automatisches Pausieren aktivieren

Sie können die Funktion zum automatischen Pausieren aktivieren, indem Sie beim Erstellen einer Sandbox-Instanz den Parameter `auto_pause` auf `true` setzen. Die Sandbox-Instanz pausiert nach dem Timeout automatisch und kann später fortgesetzt werden.

<Warning>
  Hinweis: Die fortgesetzte Sandbox-Instanz hat die Funktion zum automatischen Pausieren weiterhin aktiviert und pausiert nach dem Timeout erneut automatisch.
</Warning>

<CodeGroup>
  ```js JavaScript & TypeScript icon="js" theme={"system"}
  import { Sandbox } from 'novita-sandbox/code-interpreter';

  const sandbox = await Sandbox.create(
      {
          timeoutMs: 5_000,
          autoPause: true
      },
  );
  console.log('Sandbox created', sandbox.sandboxId)

  console.log('Waiting for 10 seconds...')
  await new Promise(resolve => setTimeout(resolve, 10000));

  const resumedSandbox = await Sandbox.connect(sandbox.sandboxId)
  console.log('Sandbox resumed', resumedSandbox.sandboxId)

  await sandbox.kill()
  ```

  ```python Python icon="python" theme={"system"}
  from novita_sandbox.core import Sandbox
  import time

  sandbox = Sandbox.create(
      timeout=5,
      auto_pause=True,
  )
  print('Sandbox created', sandbox.sandbox_id)

  print('Waiting for 10 seconds...')
  time.sleep(10)

  resumed_sandbox = Sandbox.connect(sandbox.sandbox_id)
  print('Sandbox resumed', resumed_sandbox.sandbox_id)

  sandbox.kill()
  ```
</CodeGroup>

## Automatisches Fortsetzen aktivieren

Sie können die Funktion zum automatischen Fortsetzen aktivieren, indem Sie beim Erstellen einer Sandbox-Instanz den Schlüssel `auto_resume` in `metadata` auf `true` setzen. Sobald sie aktiviert ist, wird die Sandbox automatisch fortgesetzt, wenn Sie versuchen, Vorgänge in einer pausierten Sandbox auszuführen (z. B. Befehle ausführen, Code ausführen, Dateioperationen usw.).

<Warning>
  Hinweis: Der Standard-Timeout für die fortgesetzte Sandbox beträgt 5 Minuten. Sie können den Sandbox-Timeout mit der Methode `setTimeout` oder `set_timeout` aktualisieren.
</Warning>

<CodeGroup>
  ```js JavaScript & TypeScript icon="js" theme={"system"}
  import { Sandbox } from 'novita-sandbox/code-interpreter';

  const sandbox = await Sandbox.create(
      {
          metadata:{"auto_resume": "true"}
      }
  );
  console.log('Sandbox created', sandbox.sandboxId)

  await sandbox.betaPause()
  console.log('Sandbox paused', sandbox.sandboxId)

  const result = await sandbox.commands.run('ls -al')
  console.log('Command result', result)

  await sandbox.kill()
  ```

  ```python Python icon="python" theme={"system"}
  from novita_sandbox.core import Sandbox

  sandbox = Sandbox.create(
      metadata={
          "auto_resume": "true",
      }
  )
  print('Sandbox created', sandbox.sandbox_id)

  sandbox.beta_pause()
  print('Sandbox paused', sandbox.sandbox_id)

  result = sandbox.commands.run('ls -al')
  print('Command result', result)

  sandbox.kill()
  ```
</CodeGroup>
