File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,9 +16,12 @@ A private journaling app that sends daily email prompts and creates entries from
1616# Setup
1717./bin/setup
1818
19- # Run server (use timeout to capture boot errors)
19+ # Run server (web only, use timeout to capture boot errors)
2020timeout 10 ./bin/dev || true
2121
22+ # Run server with Sidekiq worker (requires Redis)
23+ timeout 10 ./bin/dev-with-worker || true
24+
2225# Run all tests (copy .env.sample to .env first)
2326cp .env.sample .env # if not already done
2427mise exec -- bundle exec rspec
Original file line number Diff line number Diff line change @@ -60,6 +60,10 @@ After setting up, you can run the application:
6060
6161 % ./bin/dev
6262
63+ This starts just the web server. If you need background job processing (requires Redis):
64+
65+ % ./bin/dev-with-worker
66+
6367Guidelines
6468----------
6569
Original file line number Diff line number Diff line change 33
44cleanup () {
55 echo " Shutting down..."
6- kill $WEB_PID $WORKER_PID 2> /dev/null
7- wait $WEB_PID $WORKER_PID 2> /dev/null
6+ kill $WEB_PID 2> /dev/null
7+ wait $WEB_PID 2> /dev/null
88 exit 0
99}
1010
@@ -14,8 +14,4 @@ echo "Starting web server on port ${PORT:-5000}..."
1414bundle exec puma -C config/puma.rb &
1515WEB_PID=$!
1616
17- echo " Starting Sidekiq worker..."
18- bundle exec sidekiq &
19- WORKER_PID=$!
20-
2117wait
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -e
3+
4+ cleanup () {
5+ echo " Shutting down..."
6+ kill $WEB_PID $WORKER_PID 2> /dev/null
7+ wait $WEB_PID $WORKER_PID 2> /dev/null
8+ exit 0
9+ }
10+
11+ trap cleanup INT TERM
12+
13+ echo " Starting web server on port ${PORT:- 5000} ..."
14+ bundle exec puma -C config/puma.rb &
15+ WEB_PID=$!
16+
17+ echo " Starting Sidekiq worker..."
18+ bundle exec sidekiq &
19+ WORKER_PID=$!
20+
21+ wait
You can’t perform that action at this time.
0 commit comments