Skip to content

Commit

Permalink
Adjust generate-typescript-types after uvicorn's new signal handling
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard authored and renovate[bot] committed Jun 12, 2024
1 parent 5924901 commit e4edf35
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions generate-typescript-types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import os
import shutil
import signal
import socket
import time
from contextlib import closing, contextmanager
Expand Down Expand Up @@ -39,9 +40,10 @@ def running(cmd):
try:
yield proc
finally:
proc.terminate()
proc.send_signal(signal.SIGINT)
proc.wait(timeout=10)
if proc.returncode != 0:
# The Uvicorn process now returns 1 when it recieves SIGINT
if proc.returncode not in (0, 1):
raise CalledProcessError(proc.returncode, proc.args, proc.stdout, proc.stderr)


Expand All @@ -62,7 +64,7 @@ def main():
os.environ["DATABASE__SQLALCHEMY__URL"] = "sqlite:///"
print("Running API")
with running([fmn_cmd, "api", "serve", "--port", str(port)]):
time.sleep(2)
time.sleep(3)
with pushd("frontend"):
print("Building Typescript types")
call(
Expand Down

0 comments on commit e4edf35

Please sign in to comment.