Skip to content

Commit

Permalink
Fix bug where a server can't be stopped an restarted without waiting …
Browse files Browse the repository at this point in the history
…several seconds (#15729)
  • Loading branch information
desertaxle authored Jan 15, 2025
1 parent b9753e4 commit f906b70
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/prefect/cli/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def start(
# check if port is already in use
try:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((host, port))
except socket.error:
if pid_file.exists():
Expand Down

0 comments on commit f906b70

Please sign in to comment.