tpmjs/apps/railway-executor/start.sh
Thomas Davis 198f9f7d1e fix: separate sync discovery from enrichment and harden Railway executor
Sync system was timing out because discovery endpoints (keyword, changes)
also ran schema extraction (~10-15s per tool). Now discovery is fast
(npm metadata + DB writes only) and a new /api/sync/enrich endpoint
handles schema extraction in time-budgeted chunks.

Railway executor was crashing without restarting due to unhandled promise
rejections, no restart policy, and no health checks. Added crash
protection, graceful shutdown, cache size limits, railway.toml with
ALWAYS restart policy, and upgraded Deno from 1.39 to 2.1.9.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 04:49:54 +10:00

8 lines
382 B
Bash

#!/bin/bash
# Create Deno cache directory with correct permissions (runs as root)
mkdir -p /tmp/deno-cache
chown -R deno:deno /tmp/deno-cache
# Switch to deno user and run the server
# Deno 2.x: --allow-net, --allow-env, --allow-read, --allow-write, --allow-run for tool execution
exec su deno -c "deno run --allow-net --allow-env --allow-read --allow-write --allow-run server.ts"