Repository navigation
Add async job queue and scheduler infrastructure - #141
Merged
Merged
Conversation
Adopts the shared job queue + scheduler from nra-server (buzz-code/nra-server#29) and its client counterpart from nra-client (buzz-code/nra-client#37). - Bump server/shared and client/shared to the commits with the job queue, scheduler, and shared Job/Schedule client entities - Server deps: @nestjs/schedule, cron-parser - Migration creating jobs and schedules tables (idempotent CREATE TABLE IF NOT EXISTS, validated against real MySQL) - Job monitor and Schedule CRUD screens appear automatically via CommonAdminResources (admin-gated) — no App.jsx changes needed - Roadmap entry Worker is opt-in via WORKER_ENABLED=true; nothing runs until set. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011dEYULADLgGNfZ4nv6gz8s
There was a problem hiding this comment.
Pull request overview
Adopt shared async job queue + scheduler infra in app. Adds server deps + DB schema so shared Jobs/Schedules features can run, plus roadmap note.
Changes:
- Add server deps:
@nestjs/schedule,cron-parser - Add TypeORM migration creating
jobs+schedulestables - Add roadmap entry for background tasks infra
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| server/package.json | Add Nest schedule + cron parsing deps required by shared worker/scheduler |
| server/yarn.lock | Lock new deps (@nestjs/schedule, cron-parser, transitive luxon/uuid) |
| server/src/migrations/1787100000000-addJobsAndSchedulesTables.ts | Create jobs + schedules tables used by shared infra |
| client/src/roadmapFeatures.js | Mark background-jobs infra as done in roadmap |
Files not reviewed (1)
- client/src/roadmapFeatures.js: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+13
to
+14
| \`payload\` text NULL, | ||
| \`result\` text NULL, |
jobs.result can hold a base64-encoded zip from the user-data-export handler when S3 isn't configured, which routinely exceeds MySQL text's 64KB limit. Widen to longtext (matches the entity-side fix in buzz-code/nra-server#38, picked up by the server/shared bump). Verified against real MySQL: a longtext column now accepts a 200KB value that the previous text column would have rejected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011dEYULADLgGNfZ4nv6gz8s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adopts the shared async job queue + scheduler infrastructure, already merged into
nra-server(#29) andnra-client(#37), and already wired into event-management-nra and student-report-nra.Changes
server/sharedandclient/sharedto the merged commits carrying the job queue, worker, scheduler, and shared client Job/Schedule screens.@nestjs/schedule,cron-parser.1787100000000-addJobsAndSchedulesTables— createsjobsandschedulestables (idempotentCREATE TABLE IF NOT EXISTS, DDL validated against real MySQL).CommonAdminResources(admin-gated), which this app already uses. NoApp.jsxchanges needed.How to use it
WORKER_ENABLED=trueon the server instance that should process jobs (nothing runs until this is set).doActionhandler (jobService.enqueue(userId, type, payload)) or a recurring Schedule row (data-driven, no redeploy).See
nra-server'sutils/jobs/for the handler contract and the two shipped handlers (cleanup-old-jobs,user-data-export).Testing
All verified on a fresh clone of this exact branch (fresh
yarn install, real submodule checkout — no local shortcuts):tsc --noEmit: 0 errors.yarn test: 963/963 passing.yarn test:e2e: 4/4 passing.🤖 Generated with Claude Code
https://claude.ai/code/session_011dEYULADLgGNfZ4nv6gz8s