The marker a run leaves in the index when it dies or ends badly.
(state: string)
| 130 | |
| 131 | /** The marker a run leaves in the index when it dies or ends badly. */ |
| 132 | function setIndexState(state: string): void { |
| 133 | // eslint-disable-next-line @typescript-eslint/no-require-imports |
| 134 | const { DatabaseSync } = require('node:sqlite'); |
| 135 | const db = new DatabaseSync(path.join(tempDir, '.codegraph', 'codegraph.db')); |
| 136 | try { |
| 137 | db.prepare( |
| 138 | "INSERT INTO project_metadata (key, value, updated_at) VALUES ('index_state', ?, 0) " + |
| 139 | 'ON CONFLICT(key) DO UPDATE SET value = excluded.value' |
| 140 | ).run(state); |
| 141 | } finally { |
| 142 | db.close(); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | it.each([ |
| 147 | ['indexing', 'The last index run never finished'], |
no test coverage detected