mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
refactor: strengthen architecture CI gates and runtime contracts
This commit is contained in:
@@ -4,15 +4,15 @@ from fastapi import Depends
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.api.context import (
|
||||
get_agent_chat_runtime,
|
||||
get_agent_chat_repository,
|
||||
get_agent_chat_runtime,
|
||||
get_agent_chat_transaction,
|
||||
get_async_session,
|
||||
get_host_runtime,
|
||||
)
|
||||
from app.application.messaging.chat import (
|
||||
AgentChatService,
|
||||
AgentChatPersistenceService,
|
||||
AgentChatService,
|
||||
AsyncAgentChatRepository,
|
||||
AsyncUnitOfWork,
|
||||
)
|
||||
|
||||
@@ -9,25 +9,33 @@ from sqlalchemy.orm import Session
|
||||
from app.adapters.external.server import MoviePilotServerHelper
|
||||
from app.api.context import (
|
||||
get_async_session,
|
||||
get_background_task_registry,
|
||||
get_host_runtime,
|
||||
get_subscription_history_repository,
|
||||
get_subscription_outbox,
|
||||
get_subscription_repository,
|
||||
get_subscription_transaction,
|
||||
get_sync_session,
|
||||
resolve_background_task_registry,
|
||||
)
|
||||
from app.application.outbox import AsyncOutboxTransaction
|
||||
from app.application.scheduling import start_scheduler_job
|
||||
from app.application.servarr import ServarrSubscriptionService
|
||||
from app.application.subscription.delete import (
|
||||
AsyncUnitOfWork as DeleteUnitOfWork,
|
||||
)
|
||||
from app.application.subscription.delete import (
|
||||
DeleteSubscribeCommand,
|
||||
SubscribeDeletionRepository,
|
||||
)
|
||||
from app.application.subscription.identity import DeleteSubscriptionsByIdentityCommand
|
||||
from app.application.subscription.identity import SubscribeIdentityDeletionRepository
|
||||
from app.application.subscription.identity import (
|
||||
DeleteSubscriptionsByIdentityCommand,
|
||||
SubscribeIdentityDeletionRepository,
|
||||
)
|
||||
from app.application.subscription.mutation import (
|
||||
AsyncUnitOfWork as MutationUnitOfWork,
|
||||
)
|
||||
from app.application.subscription.mutation import (
|
||||
SubscriptionHistoryMutationRepository,
|
||||
SubscriptionMutationRepository,
|
||||
SubscriptionMutationService,
|
||||
@@ -36,10 +44,9 @@ from app.application.subscription.query import SubscriptionQueryService
|
||||
from app.application.subscription.search import SearchSubscriptionsCommand
|
||||
from app.runtime.events import eventmanager
|
||||
from app.runtime.log import logger
|
||||
from app.runtime.tasks import TaskRegistry
|
||||
from app.schemas.types import EventType
|
||||
from app.startup.composition.context import HostRuntime
|
||||
from app.api.context import get_background_task_registry, resolve_background_task_registry
|
||||
from app.runtime.tasks import TaskRegistry
|
||||
|
||||
|
||||
async def _publish_subscribe_deleted(
|
||||
|
||||
@@ -16,7 +16,7 @@ from app.application.workflow import (
|
||||
WorkflowQueryService,
|
||||
get_workflow_manager,
|
||||
)
|
||||
from app.runtime.config import global_vars
|
||||
from app.runtime.stop import runtime_stop_state
|
||||
from app.startup.composition.context import HostRuntime
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ def get_workflow_mutation_command(
|
||||
load_event=workflow_manager.load_workflow_events,
|
||||
remove_event=workflow_manager.remove_workflow_event,
|
||||
refresh_event=workflow_manager.update_workflow_event,
|
||||
stop_running=global_vars.stop_workflow,
|
||||
stop_running=runtime_stop_state.stop_workflow,
|
||||
delete_cache=lambda workflow_id: system_config.delete(
|
||||
f"WorkflowCache-{workflow_id}"
|
||||
),
|
||||
@@ -52,7 +52,7 @@ def get_workflow_definition_command(
|
||||
return WorkflowDefinitionCommand(
|
||||
repository=runtime.workflow.repository(db),
|
||||
unit_of_work=runtime.persistence.async_transaction(db),
|
||||
stop_running=global_vars.stop_workflow,
|
||||
stop_running=runtime_stop_state.stop_workflow,
|
||||
async_delete_cache=lambda workflow_id: system_config.async_delete(
|
||||
f"WorkflowCache-{workflow_id}"
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user