27 lines
778 B
Markdown
27 lines
778 B
Markdown
# healthcheck
|
|
|
|
This document is auto-generated from the JSDoc comments in `src/store` by running `npm run api-doc`.
|
|
|
|
## `healthcheck.check`
|
|
|
|
*Source: `src/store/healthcheck/check.js`*
|
|
|
|
Executes a database health check: 1. Ensures the healthcheck table has one row (creates with sequence 0 if not). 2. Selects that row for update with minimal, reasonable locking within a transaction. 3. Updates the sequence by 1 in a separate statement within the transaction.
|
|
|
|
**Parameters**
|
|
|
|
| Name | Type | Description |
|
|
| --- | --- | --- |
|
|
| `[tx]` | `object` | Optional transaction to run within. |
|
|
|
|
**Returns**
|
|
|
|
`Promise<{ok: boolean, sequence: number}>` — The health check result.
|
|
|
|
**Example**
|
|
|
|
```js
|
|
const result = await store.healthcheck.check();
|
|
// => { ok: true, sequence: 1 }
|
|
```
|