Trying to fix thread leak: maybe some async will help?
This commit is contained in:
parent
d5a0cef68f
commit
900b5ccd8e
|
|
@ -1,5 +1,5 @@
|
|||
from chain_service.services.audio_converter import AudioConverterService
|
||||
|
||||
|
||||
def get_audio_converter_service() -> AudioConverterService:
|
||||
async def get_audio_converter_service() -> AudioConverterService:
|
||||
return AudioConverterService()
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@ from fastapi import Depends
|
|||
from typing import Annotated
|
||||
|
||||
|
||||
def get_chain_repository(database: Annotated[Database, Depends(get_database)]) -> ChainRepository:
|
||||
async def get_chain_repository(database: Annotated[Database, Depends(get_database)]) -> ChainRepository:
|
||||
return ChainRepository(database=database)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from chain_service.settings import Settings
|
|||
from chain_service.database.database import Database
|
||||
|
||||
|
||||
def get_database() -> Database:
|
||||
async def get_database() -> Database:
|
||||
settings = Settings()
|
||||
|
||||
return Database(
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from chain_service.repositories.uploaded_file import UploadedFileRepository
|
|||
from chain_service.services.audio_converter import AudioConverterService
|
||||
|
||||
|
||||
def get_file_uploader_service(
|
||||
async def get_file_uploader_service(
|
||||
planfix_client: Annotated[PlanfixClient, Depends(get_planfix_client)],
|
||||
uploaded_file_repository: Annotated[UploadedFileRepository, Depends(get_uploaded_file_repository)],
|
||||
audio_converter_service: Annotated[AudioConverterService, Depends(get_audio_converter_service)],
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ from fastapi import Depends
|
|||
from typing import Annotated
|
||||
|
||||
|
||||
def get_namespace_repository(database: Annotated[Database, Depends(get_database)]) -> NamespaceRepository:
|
||||
async def get_namespace_repository(database: Annotated[Database, Depends(get_database)]) -> NamespaceRepository:
|
||||
return NamespaceRepository(database=database)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from planfix_client import PlanfixClient
|
|||
from chain_service.settings import Settings
|
||||
|
||||
|
||||
def get_planfix_client() -> PlanfixClient:
|
||||
async def get_planfix_client() -> PlanfixClient:
|
||||
settings = Settings()
|
||||
|
||||
return PlanfixClient(
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from typing import Annotated
|
|||
from chain_service.repositories.uploaded_file import UploadedFileRepository
|
||||
|
||||
|
||||
def get_progress_action_service_factory(
|
||||
async def get_progress_action_service_factory(
|
||||
planfix_client: Annotated[PlanfixClient, Depends(get_planfix_client)],
|
||||
uploaded_file_repository: Annotated[UploadedFileRepository, Depends(get_uploaded_file_repository)]
|
||||
) -> ProgressActionServiceFactory:
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from fastapi import Depends
|
|||
from typing import Annotated
|
||||
|
||||
|
||||
def get_progress_chain_repository(
|
||||
async def get_progress_chain_repository(
|
||||
database: Annotated[Database, Depends(get_database)],
|
||||
) -> ProgressChainRepository:
|
||||
return ProgressChainRepository(database=database)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ from chain_service.repositories.running_chain import RunningChainRepository
|
|||
from chain_service.services.progress_action.factory import ProgressActionServiceFactory
|
||||
|
||||
|
||||
def get_progress_chain_runner_service(
|
||||
async def get_progress_chain_runner_service(
|
||||
progress_chain_repository: Annotated[ProgressChainRepository, Depends(get_progress_chain_repository)],
|
||||
progress_action_service_factory: Annotated[ProgressActionServiceFactory, Depends(get_progress_action_service_factory)],
|
||||
running_chain_repository: Annotated[RunningChainRepository, Depends(get_running_chain_repository)],
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from fastapi import Depends
|
|||
from typing import Annotated
|
||||
|
||||
|
||||
def get_running_chain_repository(
|
||||
async def get_running_chain_repository(
|
||||
database: Annotated[Database, Depends(get_database)],
|
||||
) -> RunningChainRepository:
|
||||
return RunningChainRepository(database=database)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from fastapi import Depends
|
|||
from typing import Annotated
|
||||
|
||||
|
||||
def get_uploaded_file_repository(
|
||||
async def get_uploaded_file_repository(
|
||||
database: Annotated[Database, Depends(get_database)],
|
||||
) -> UploadedFileRepository:
|
||||
return UploadedFileRepository(database=database)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user