Skip to content

Commit

Permalink
fixes harness#1523 to ensure json-file driver (harness#2083)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrydzewski authored Jun 22, 2017
1 parent b833b16 commit 3ed8116
Show file tree
Hide file tree
Showing 10 changed files with 289 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pipeline:
image: plugins/docker
repo: drone/drone
secrets: [ docker_username, docker_password ]
tag: [ 0.7, 0.7.1 ]
tag: [ 0.7, 0.7.2 ]
when:
event: tag

Expand Down
7 changes: 3 additions & 4 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<!-- PLEASE READ BEFORE DELETING
Bugs or Issues? Please do not open a GitHub issue until you have
discussed and verified on the mailing list:
discussed and verified in our chatroom:
http://discourse.drone.io/
https://gitter.im/drone/drone
Failing Builds? Please do not use GitHub issues for generic support
questions. Instead use the mailing list or Stack Overflow:
questions. Instead please use Stack Overflow:
http://discourse.drone.io/
http://stackoverflow.com/questions/tagged/drone.io
-->
26 changes: 26 additions & 0 deletions server/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,17 @@ func (s *RPC) Next(c context.Context, filter rpc.Filter) (*rpc.Pipeline, error)
return nil, nil
}
pipeline := new(rpc.Pipeline)

// check if the process was previously cancelled
// cancelled, _ := s.checkCancelled(pipeline)
// if cancelled {
// logrus.Debugf("ignore pid %v: cancelled by user", pipeline.ID)
// if derr := s.queue.Done(c, pipeline.ID); derr != nil {
// logrus.Errorf("error: done: cannot ack proc_id %v: %s", pipeline.ID, err)
// }
// return nil, nil
// }

err = json.Unmarshal(task.Data, pipeline)
return pipeline, err
}
Expand Down Expand Up @@ -442,3 +453,18 @@ func (s *RPC) Log(c context.Context, id string, line *rpc.Line) error {
s.logger.Write(c, id, entry)
return nil
}

func (s *RPC) checkCancelled(pipeline *rpc.Pipeline) (bool, error) {
pid, err := strconv.ParseInt(pipeline.ID, 10, 64)
if err != nil {
return false, err
}
proc, err := s.store.ProcLoad(pid)
if err != nil {
return false, err
}
if proc.State == model.StatusKilled {
return true, nil
}
return false, err
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3ed8116

Please sign in to comment.