Skip to content

Commit

Permalink
persist service after first request
Browse files Browse the repository at this point in the history
We still have the advantage of zero downtime restarts but given this is on the only service on the machine we can just run it all the time
  • Loading branch information
Mic92 authored and mergify[bot] committed Nov 12, 2023
1 parent 8a81493 commit 0deae35
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions nixpkgs_merge_bot/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ def start_server(settings: Settings) -> None:
fds = range(3, 3 + int(nfds))
for fd in fds:
sock = socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(0)

try:
while True:
while True:
try:
GithubWebHook(*sock.accept(), settings)
except BlockingIOError:
# no more connections
pass
except OSError:
# connection closed
pass
except OSError:
# connection closed
pass
else:
serversocket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
try:
Expand Down

0 comments on commit 0deae35

Please sign in to comment.