Skip to content

Commit

Permalink
use model_cosntruct
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Oct 15, 2024
1 parent adc9878 commit b49ec5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def progress_tasks_message(
async def post_task_progress_message(app: FastAPI, task: Task, progress: float) -> None:
with log_catch(logger, reraise=False):
simcore_label_keys = StandardSimcoreDockerLabels.from_docker_task(task)
message = ProgressRabbitMessageNode.construct(
message = ProgressRabbitMessageNode.model_construct(
node_id=simcore_label_keys.node_id,
user_id=simcore_label_keys.user_id,
project_id=simcore_label_keys.project_id,
Expand All @@ -55,7 +55,7 @@ async def post_task_progress_message(app: FastAPI, task: Task, progress: float)
async def post_task_log_message(app: FastAPI, task: Task, log: str, level: int) -> None:
with log_catch(logger, reraise=False):
simcore_label_keys = StandardSimcoreDockerLabels.from_docker_task(task)
message = LoggerRabbitMessage.construct(
message = LoggerRabbitMessage.model_construct(
node_id=simcore_label_keys.node_id,
user_id=simcore_label_keys.user_id,
project_id=simcore_label_keys.project_id,
Expand All @@ -79,7 +79,7 @@ async def create_autoscaling_status_message(
origin = f"dynamic:node_labels={app_settings.AUTOSCALING_NODES_MONITORING.NODES_MONITORING_NODE_LABELS}"
elif app_settings.AUTOSCALING_DASK:
origin = f"computational:scheduler_url={app_settings.AUTOSCALING_DASK.DASK_MONITORING_URL}"
return RabbitAutoscalingStatusMessage.construct(
return RabbitAutoscalingStatusMessage.model_construct(
origin=origin,
nodes_total=len(cluster.active_nodes)
+ len(cluster.drained_nodes)
Expand Down
2 changes: 1 addition & 1 deletion services/autoscaling/tests/unit/test_modules_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

_authentication_types = [
NoAuthentication(),
TLSAuthentication.construct(
TLSAuthentication.model_construct(
**TLSAuthentication.model_config["json_schema_extra"]["examples"][0]
),
]
Expand Down

0 comments on commit b49ec5c

Please sign in to comment.