feat: integrate tasks/cron server into custom Next.js server

- Add tasks dependencies (fastify, cron-job-api, cron-jobs, etc.) to nextjs app
- Import and start tasks (JobManager, jobGroup, Fastify cron API) in server.ts
- Update root package.json start script to remove tasks.cjs
- Update scripts/run.sh to run single process
- Update Dockerfile to not copy tasks.cjs
- Disable tasks dev script (no-op)

Co-authored-by: ajnart <49837342+ajnart@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]andajnart committed 2026-03-03 08:45:53 +00:00
1 parent 835ecd0d28
commit 9951f88926
7 files changed
+238 -11

No files matched your search

+2 -5
View File
@@ -45,17 +45,14 @@ fi
node apps/tasks/tasks.cjs &
TASKS_PID=$!
# WebSocket server is now integrated into the custom Next.js server
# Tasks/cron and WebSocket servers are now integrated into the custom Next.js server
node apps/nextjs/customServer.cjs &
NEXTJS_PID=$!
# Function to handle SIGTERM and shut down services
terminate() {
echo "Received SIGTERM. Shutting down..."
kill -TERM $NGINX_PID $TASKS_PID $NEXTJS_PID 2>/dev/null
kill -TERM $NGINX_PID $NEXTJS_PID 2>/dev/null
wait
# kill redis-server last because of logging of other services and only if $REDIS_PID is set
if [ -n "$REDIS_PID" ]; then