Skip to content

Commit

Permalink
ongoing
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Nov 18, 2024
1 parent e4c3e8d commit 2cf081b
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,32 @@
from typing import cast

from fastapi import FastAPI
from models_library.projects import ProjectID
from models_library.users import UserID
from servicelib.logging_utils import log_context

from ...utils.comp_scheduler import Iteration
from ..db import get_db_engine
from ..db.repositories.comp_runs import CompRunsRepository
from ..rabbitmq import get_rabbitmq_client
from ._models import SchedulePipelineRabbitMessage
from ._publisher import request_pipeline_scheduling
from ._scheduler_base import BaseCompScheduler
from ._scheduler_factory import create_scheduler

_logger = logging.getLogger(__name__)


def _empty_wake_up_callack() -> None:
# TODO: need to re-publish here?
return
def _empty_wake_up_callack(
app: FastAPI, user_id: UserID, project_id: ProjectID, iteration: Iteration
) -> None:
async def _async_cb():
db_engine = get_db_engine(app)
rabbit_mq_client = get_rabbitmq_client(app)
comp_run = await CompRunsRepository.instance(db_engine).get(
user_id=user_id, project_id=project_id, iteration=iteration
)
await request_pipeline_scheduling(comp_run, rabbit_mq_client, db_engine)


def _get_scheduler_worker(app: FastAPI) -> BaseCompScheduler:
Expand Down

0 comments on commit 2cf081b

Please sign in to comment.