mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-29 22:02:05 +00:00
fix: use port-based process killing for cross-platform safety
Addresses reviewer feedback: 1. Windows Compatibility: Added Windows alternative using netstat/taskkill 2. Safer Process Killing: Changed from `pkill -f "node"` to port-based killing (`lsof -ti :$PORT`) to avoid killing unrelated Node processes like VS Code, Claude Code, or other development tools Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -155,8 +155,11 @@ Steps:
|
||||
Steps:
|
||||
1. Create unique test data via API (e.g., POST /api/items with name "RESTART_TEST_12345")
|
||||
2. Verify data appears in API response (GET /api/items)
|
||||
3. STOP the server completely: pkill -f "node" && sleep 5
|
||||
4. Verify server is stopped: pgrep -f "node" returns nothing
|
||||
3. STOP the server completely (kill by port to avoid killing unrelated Node processes):
|
||||
- Unix/macOS: lsof -ti :$PORT | xargs kill -9 2>/dev/null || true && sleep 5
|
||||
- Windows: FOR /F "tokens=5" %a IN ('netstat -aon ^| find ":$PORT"') DO taskkill /F /PID %a 2>nul
|
||||
- Note: Replace $PORT with actual port (e.g., 3000)
|
||||
4. Verify server is stopped: lsof -ti :$PORT returns nothing (or netstat on Windows)
|
||||
5. RESTART the server: ./init.sh & sleep 15
|
||||
6. Query API again: GET /api/items
|
||||
7. Verify "RESTART_TEST_12345" still exists
|
||||
|
||||
Reference in New Issue
Block a user