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

Function createLog

packages/computerd/src/exec/log.ts:50–58  ·  view source on GitHub ↗
(db: Database, id: string, opts: LogOptions)

Source from the content-addressed store, hash-verified

48// same id already exists — the runner is responsible for disposing
49// stale records before spawning a recycled id.
50export function createLog(db: Database, id: string, opts: LogOptions): EventLog {
51 const startedAt = opts.now();
52 db.run(
53 `INSERT INTO computerd_exec_meta (exec_id, started_at, bytes, evicted) VALUES (?, ?, 0, 0)`,
54 id,
55 startedAt,
56 );
57 return new EventLog(db, id, opts);
58}
59
60// Reattach to an existing log row. Returns undefined if no meta
61// row exists for the id (i.e. the exec was never spawned, or has

Callers 2

execMethod · 0.85
spawnFailedMethod · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected