Skip to content

Commit 75d7fc6

Browse files
author
Tom Softreck
committed
update
1 parent b0829e6 commit 75d7fc6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,20 @@ publish-full:
9595

9696
# Start the WebTask server
9797
start:
98-
@echo "Starting WebTask server on $(HOST):$(PORT)..."
98+
@echo "Starting WebTask server on $(HOST):$(PORT) in foreground..."
9999
@poetry run webtask --host $(HOST) --port $(PORT)
100100

101101
# Stop the WebTask server
102102
stop:
103103
@echo "Stopping WebTask server on port $(PORT)..."
104-
@-pkill -f "python.*webtask.*--host $(HOST).*--port $(PORT)" || echo "No WebTask server found running on port $(PORT)"
105-
@-pkill -f "webtask.*--host $(HOST).*--port $(PORT)" || true
104+
@-PID=$$(lsof -t -i:$(PORT) -sTCP:LISTEN); \
105+
if [ -n "$$PID" ]; then \
106+
echo "Killing process $$PID on port $(PORT)"; \
107+
kill -9 $$PID || echo "Failed to kill process $$PID. It might have already stopped."; \
108+
sleep 1; \
109+
else \
110+
echo "No WebTask server found running on port $(PORT)"; \
111+
fi
106112

107113
# Restart the WebTask server
108114
restart: stop start

0 commit comments

Comments
 (0)