You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: development/backend/job-queue.mdx
+42-26Lines changed: 42 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Background worker loop that polls the database every second, processes jobs sequ
30
30
Plugin-style pattern where each worker implements the `Worker` interface. Workers are registered by type (e.g., `send_email`, `process_csv`, `sync_registry`) and execute specific job types.
31
31
32
32
### Database Tables
33
-
Two tables provide persistence: `queueJobs` stores individual jobs with payloadand status, while `queueJobBatches` tracks groups of related jobs for progress monitoring.
33
+
Two tables provide persistence: `queueJobs` stores individual jobs with payload, status, and result data, while `queueJobBatches` tracks groups of related jobs for progress monitoring.
34
34
35
35
## Core Concepts
36
36
@@ -92,10 +92,12 @@ interface Worker {
92
92
interfaceWorkerResult {
93
93
success:boolean;
94
94
message?:string;
95
-
data?:any;
95
+
data?:any;// Persisted to database on job completion
96
96
}
97
97
```
98
98
99
+
The `data` field in `WorkerResult` is automatically stored in the database when a job completes successfully. This allows you to inspect job results through the admin UI or database queries.
100
+
99
101
### Basic Worker Pattern
100
102
101
103
```typescript
@@ -136,7 +138,8 @@ export class EmailWorker implements Worker {
0 commit comments