Added redis and worker services

This commit is contained in:
blaisadmin
2026-05-02 00:14:56 -04:00
parent 5a3ca9021a
commit 673df353b9
15 changed files with 833 additions and 15 deletions
+55
View File
@@ -323,6 +323,61 @@ Response `200`:
{ "ok": true }
```
### Metrics
#### `GET /api/metrics`
Requires auth and an admin user. Returns lightweight in-memory process and request counters for the current backend process.
Response `200`:
```json
{
"startedAt": "2026-05-01T00:00:00.000Z",
"uptimeSeconds": 120,
"requests": {
"total": 10,
"inFlight": 0,
"errors": 0,
"averageDurationMs": 12.5,
"byStatus": { "2xx": 10 },
"byRoute": { "GET /api/health": 10 }
},
"memory": {
"rss": 0,
"heapTotal": 0,
"heapUsed": 0,
"external": 0,
"arrayBuffers": 0
},
"queues": {
"birdMilestoneReminders": {
"waiting": 0,
"active": 0,
"delayed": 0,
"completed": 0,
"failed": 0
}
}
}
```
### Admin
#### `PATCH /api/admin/rescue-workspaces/:workspaceId`
Requires an admin user. Browser session tokens and admin-owned `read_write` integration tokens are accepted, so automation tools can approve or reject rescue claims after external validation.
Request body:
```json
{
"rescueVerificationStatus": "approved"
}
```
Allowed statuses are `pending`, `approved`, and `rejected`.
### Authentication
#### `GET /api/auth/providers`