Skip to content

Commit

Permalink
Fix descending logs (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
r4victor authored Jan 18, 2024
1 parent 607da11 commit 3121673
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dstack/_internal/server/services/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def poll_logs(
project: ProjectModel,
request: PollLogsRequest,
) -> JobSubmissionLogs:
# TODO Respect request.limit to support pagination
if request.diagnose:
log_file_path = _get_runner_log_file_path(
project_name=project.name,
Expand All @@ -79,6 +80,8 @@ def poll_logs(
break
except IOError:
pass
if request.descending:
logs = list(reversed(logs))
return JobSubmissionLogs(logs=logs)


Expand Down

0 comments on commit 3121673

Please sign in to comment.