8000 fix: avoid missed logs when streaming startup logs by mafredri · Pull Request #8029 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix: avoid missed logs when streaming startup logs #8029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 16, 2023
Prev Previous commit
Next Next commit
Fix after qp
  • Loading branch information
mafredri committed Jun 16, 2023
commit a1a40f37f72ee37ddb808ed7024815ad099b4cd0
9 changes: 3 additions & 6 deletions
Original file line number Diff line number Diff line change
Expand Up @@ -434,19 +434,16 @@ func (api *API) workspaceAgentStartupLogs(rw http.ResponseWriter, r *http.Reques
if afterRaw != "" {
var err error
after, err = strconv.ParseInt(afterRaw, 10, 64)
if err != nil {
if err != nil || after < 0 {
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
Message: "Query param \"after\" must be an integer.",
Message: "Query param \"after\" must be an integer greater than zero.",
Validations: []codersdk.ValidationError{
{Field: "after", Detail: "Must be an integer"},
{Field: "after", Detail: "Must be an integer greater than zero"},
},
})
return
}
}
if after < 0 {
after = 0
}

logs, err := api.Database.GetWorkspaceAgentStartupLogsAfter(ctx, database.GetWorkspaceAgentStartupLogsAfterParams{
AgentID: workspaceAgent.ID,
Expand Down
0