Skip to content

Commit e267d86

Browse files
final cleanup before introducing dag list field to comp_runs
1 parent a8b20ef commit e267d86

File tree

3 files changed

+2
-40
lines changed

3 files changed

+2
-40
lines changed

services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_runs.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from models_library.users import UserID
1515
from models_library.utils.fastapi_encoders import jsonable_encoder
1616
from pydantic import PositiveInt
17-
from simcore_postgres_database.utils_comp_runs import get_latest_run_id_for_project
1817
from simcore_postgres_database.utils_repos import (
1918
pass_or_acquire_connection,
2019
transaction_context,
@@ -351,16 +350,6 @@ async def list_for_user_and_project_all_iterations(
351350

352351
return cast(int, total_count), items
353352

354-
async def get_latest_run_id_for_project(
355-
self,
356-
conn: AsyncConnection | None = None,
357-
*,
358-
project_id: ProjectID,
359-
) -> PositiveInt:
360-
return await get_latest_run_id_for_project(
361-
self.db_engine, conn, project_id=f"{project_id}"
362-
)
363-
364353
async def create(
365354
self,
366355
*,

services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_runs_snapshot_tasks.py

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,6 @@ async def batch_create(
3333
),
3434
data,
3535
)
36-
# rows = result.fetchall()
37-
# return [CompRunSnapshotTaskAtDBGet.model_validate(row) for row in rows]
38-
except Exception as e:
39-
logger.error(
40-
"Failed to batch create comp run snapshot tasks: %s",
41-
e,
42-
exc_info=True,
43-
)
36+
except Exception:
37+
logger.exception("Failed to batch create comp run snapshot tasks")
4438
raise
45-
46-
# async def update_for_run_id_and_node_id(
47-
# self,
48-
# connection: AsyncConnection | None = None,
49-
# *,
50-
# run_id: PositiveInt,
51-
# node_id: NodeID,
52-
# data: dict,
53-
# ) -> CompRunSnapshotTaskAtDBGet:
54-
# row = await update_for_run_id_and_node_id(
55-
# self.db_engine,
56-
# conn=connection,
57-
# run_id=run_id,
58-
# node_id=f"{node_id}",
59-
# data=data,
60-
# )
61-
# return CompRunSnapshotTaskAtDBGet.model_validate(row)

services/director-v2/src/simcore_service_director_v2/modules/db/repositories/comp_tasks/_core.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ async def upsert_tasks_from_project(
200200
# NOTE: comp_tasks DB only trigger a notification to the webserver if an UPDATE on comp_tasks.outputs or comp_tasks.state is done
201201
# NOTE: an exception to this is when a frontend service changes its output since there is no node_ports, the UPDATE must be done here.
202202

203-
# NOTE: MD here I do not need to update the new db table!!! (remove this comment)
204-
205203
inserted_comp_tasks_db: list[CompTaskAtDB] = []
206204
for comp_task_db in list_of_comp_tasks_in_project:
207205
insert_stmt = insert(comp_tasks).values(
@@ -277,8 +275,6 @@ async def _update_task(
277275
async def mark_project_published_waiting_for_cluster_tasks_as_aborted(
278276
self, project_id: ProjectID, run_id: PositiveInt
279277
) -> None:
280-
# NOTE: MD here is creation/update of comp_tasks table
281-
282278
# block all pending tasks, so the sidecars stop taking them
283279
async with self.db_engine.begin() as conn:
284280
await conn.execute(

0 commit comments

Comments
 (0)