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: webapp/README.md
+7-13Lines changed: 7 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,30 +188,24 @@ This project uses type-safe server actions with authentication:
188
188
189
189
### Asynchronous Jobs
190
190
191
-
Asynchronous jobs are Lambda functions that handle long-running or background tasks. The `job.Dockerfile` builds all TypeScript files in `src/jobs/` into separate Lambda handlers using `esbuild src/jobs/*.ts --bundle`.
191
+
Asynchronous jobs are Lambda functions that handle long-running or background tasks. All async jobs are invoked through a single Lambda function (`async-job-runner.ts`) and can be triggered manually or as scheduled jobs.
192
192
193
193
**File structure:**
194
194
195
-
For simple jobs, place a single file directly under `src/jobs/`:
195
+
Place each job's implementation in a subdirectory under `src/jobs/`:
├── async-job-runner.ts # Lambda handler entry point
208
-
└── async-job/ # Business logic directory
199
+
├── async-job-runner.ts # Lambda handler entry point (dispatches to jobs)
200
+
└── async-job/ # Job implementations directory
209
201
└── translate.ts # Job implementation
210
202
```
211
203
204
+
The `async-job-runner.ts` handler dispatches to the appropriate job based on the event payload type.
205
+
212
206
**Deployment:**
213
207
214
-
All jobs share the same `job.Dockerfile`. The CDK stack overrides the entry point using the `cmd` parameter in `DockerImageCode.fromImageAsset()`:
208
+
The `job.Dockerfile` builds all TypeScript files in `src/jobs/` using `esbuild src/jobs/*.ts --bundle`. The CDK stack overrides the entry point using the `cmd` parameter:
0 commit comments