Skip to content

Commit

Permalink
fix ui issues
Browse files Browse the repository at this point in the history
  • Loading branch information
msarvar committed Sep 16, 2021
1 parent 586a0c7 commit d11200e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/controllers/logstreaming_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (j *JobsController) GetProjectJobsWS(w http.ResponseWriter, r *http.Request

pull := projectInfo.String()
err = j.ProjectCommandOutputHandler.Receive(pull, receiver, func(msg string) error {
if err := c.WriteMessage(websocket.BinaryMessage, []byte(msg+"\r\n\t")); err != nil {
if err := c.WriteMessage(websocket.BinaryMessage, []byte("\r\n"+msg)); err != nil {
j.Logger.Warn("Failed to write ws message: %s", err)
return err
}
Expand Down
2 changes: 1 addition & 1 deletion server/events/models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (

const (
planfileSlashReplace = "::"
LogStreamingClearMsg = "\t\n-----Starting New Process-----\n"
LogStreamingClearMsg = "\n-----Starting New Process-----"
)

type PullReqStatus struct {
Expand Down
2 changes: 1 addition & 1 deletion server/events/terraform/terraform_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ func (c *DefaultClient) RunCommandAsync(ctx models.ProjectCommandContext, path s
// Don't stream terraform show output to outCh
cmds := strings.Split(tfCmd, " ")
if isValidCommand(cmds[1]) {
c.projectCmdOutputHandler.Send(ctx, fmt.Sprintf("\n----- running terraform %s -----\n", args[0]))
c.projectCmdOutputHandler.Send(ctx, fmt.Sprintf("\n----- running terraform %s -----", args[0]))
}
s := bufio.NewScanner(stdout)
for s.Scan() {
Expand Down
5 changes: 5 additions & 0 deletions server/handlers/project_command_output_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ func (p *AsyncProjectCommandOutputHandler) writeLogLine(pull string, line string
}
p.receiverBuffersLock.Unlock()

// No need to write to projectOutputBuffers if clear msg.
if line == models.LogStreamingClearMsg {
return
}

p.projectOutputBuffersLock.Lock()
if p.projectOutputBuffers[pull] == nil {
p.projectOutputBuffers[pull] = []string{}
Expand Down

0 comments on commit d11200e

Please sign in to comment.