diff --git a/inboard/app/utilities.py b/inboard/app/utilities.py index 39e334e..01e4665 100644 --- a/inboard/app/utilities.py +++ b/inboard/app/utilities.py @@ -1,7 +1,7 @@ import base64 import os from secrets import compare_digest -from typing import Tuple, Union +from typing import Optional, Tuple from fastapi import Depends, HTTPException, status from fastapi.security import HTTPBasic, HTTPBasicCredentials @@ -17,7 +17,7 @@ class BasicAuth(AuthenticationBackend): async def authenticate( self, request: HTTPConnection - ) -> Union[Tuple[AuthCredentials, SimpleUser], None]: + ) -> Optional[Tuple[AuthCredentials, SimpleUser]]: if "Authorization" not in request.headers: return None diff --git a/inboard/gunicorn_conf.py b/inboard/gunicorn_conf.py index af33526..cb736d8 100644 --- a/inboard/gunicorn_conf.py +++ b/inboard/gunicorn_conf.py @@ -1,13 +1,13 @@ import multiprocessing import os -from typing import Union +from typing import Optional from inboard.start import configure_logging def calculate_workers( - max_workers_str: Union[str, None], - web_concurrency_str: Union[str, None], + max_workers_str: Optional[str], + web_concurrency_str: Optional[str], workers_per_core_str: str, cores: int = multiprocessing.cpu_count(), ) -> int: