File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -95,14 +95,20 @@ publish-full:
9595
9696# Start the WebTask server
9797start :
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
102102stop :
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
108114restart : stop start
You can’t perform that action at this time.
0 commit comments