(db: Database, id: string, opts: LogOptions)
| 48 | // same id already exists — the runner is responsible for disposing |
| 49 | // stale records before spawning a recycled id. |
| 50 | export 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 |
no test coverage detected