Skip to content

Commit

Permalink
Return deleted runs in /api/runs/list
Browse files Browse the repository at this point in the history
  • Loading branch information
r4victor committed Dec 30, 2024
1 parent b315d52 commit c59f775
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/dstack/_internal/server/routers/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ async def list_runs(
"""
Returns all runs visible to user sorted by descending `submitted_at`.
`project_name`, `repo_id`, `username`, and `only_active` can be specified as filters.
Setting `only_active` to `true`, excludes finished runs and deleted runs.
Specifying `repo_id` without `project_name` returns no runs.
The results are paginated. To get the next page, pass `submitted_at` and `id` of
Expand Down
3 changes: 2 additions & 1 deletion src/dstack/_internal/server/services/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ async def list_projects_run_models(
limit: int,
ascending: bool,
) -> List[RunModel]:
filters = [RunModel.deleted == False, RunModel.project_id.in_(p.id for p in projects)]
filters = []
filters.append(RunModel.project_id.in_(p.id for p in projects))
if repo is not None:
filters.append(RunModel.repo_id == repo.id)
if runs_user is not None:
Expand Down

0 comments on commit c59f775

Please sign in to comment.