This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: add separate script for running feed-worker process

Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>

+36
+1
package.json
··· 24 24 "build": "tsup", 25 25 "build:watch": "tsc --watch", 26 26 "dev:inner": "dotenv -e .env.local -- concurrently -k -n TYPE,APP -c red,blue \"tsc --noEmit --watch\" \"tsup --watch --onSuccess='node dist/index.js'\"", 27 + "dev:worker:feeds": "dotenv -e .env.local -- concurrently -k -n TYPE,WORKER -c red,green \"tsc --noEmit --watch\" \"tsup --watch --onSuccess='node dist/workers/feed-worker.js'\"", 27 28 "dev:mock": "USE_MOCK_REPOS=true USE_FAKE_PUBLISHERS=true USE_MOCK_AUTH=true npm run dev:inner", 28 29 "dev:mock:pub:auth": "USE_FAKE_PUBLISHERS=true USE_MOCK_AUTH=true npm run dev", 29 30 "dev": "bash ./scripts/dev.sh",
+35
scripts/dev-feed-worker.sh
··· 1 + #!/bin/bash 2 + 3 + # Check if Docker daemon is running 4 + if ! docker info > /dev/null 2>&1; then 5 + echo "Error: Docker daemon is not running. Please start Docker and try again." 6 + exit 1 7 + fi 8 + 9 + # Check if the Redis container is running 10 + if [ "$(docker ps -q -f name=annos-redis)" ]; then 11 + echo "Redis container is already running." 12 + REDIS_RUNNING=true 13 + else 14 + echo "Starting Redis container..." 15 + npm run redis:start 16 + REDIS_RUNNING=false 17 + fi 18 + 19 + # Trap SIGINT and SIGTERM to stop containers on exit, only if we started them 20 + function cleanup { 21 + if [ "$REDIS_RUNNING" = false ]; then 22 + if [ "$(docker ps -q -f name=annos-redis)" ]; then 23 + echo "Stopping Redis container..." 24 + npm run redis:stop 25 + npm run redis:remove 26 + fi 27 + fi 28 + } 29 + trap cleanup SIGINT SIGTERM 30 + 31 + # Run the feed worker dev command 32 + npm run dev:worker:feeds 33 + 34 + # Cleanup after dev command exits 35 + cleanup