MCPcopy Create free account
hub / github.com/cloudflare/computer / constructor

Method constructor

packages/computerd/src/exec/runner.ts:88–102  ·  view source on GitHub ↗
(init: RunnerInit)

Source from the content-addressed store, hash-verified

86 private disposed = false;
87
88 constructor(init: RunnerInit) {
89 this.db = init.db;
90 this.opts = {
91 cwd: init.cwd,
92 env: init.env,
93 logMaxBytes: init.logMaxBytes ?? DEFAULTS.logMaxBytes,
94 retentionMs: init.retentionMs ?? DEFAULTS.retentionMs,
95 sweepIntervalMs: init.sweepIntervalMs ?? DEFAULTS.sweepIntervalMs,
96 defaultTimeoutMs: init.defaultTimeoutMs ?? DEFAULTS.defaultTimeoutMs,
97 heartbeatIntervalMs: init.heartbeatIntervalMs ?? 0,
98 now: init.now ?? Date.now,
99 };
100 initializeExecSchema(this.db);
101 if (init.resetSchema !== false) clearExecState(this.db);
102 }
103
104 exec(command: string, options: ExecOptions = {}): ExecHandle {
105 if (this.disposed) throw new Error("runner disposed");

Callers

nothing calls this directly

Calls 2

initializeExecSchemaFunction · 0.85
clearExecStateFunction · 0.85

Tested by

no test coverage detected