mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 12:21:03 +00:00
set machine on proc update
This commit is contained in:
parent
250b048b22
commit
9720337655
1 changed files with 8 additions and 8 deletions
|
@ -144,6 +144,14 @@ func (s *RPC) Update(c context.Context, id string, state rpc.State) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
metadata, ok := metadata.FromContext(c)
|
||||||
|
if ok {
|
||||||
|
hostname, ok := metadata["hostname"]
|
||||||
|
if ok && len(hostname) != 0 {
|
||||||
|
proc.Machine = hostname[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
repo, err := s.store.GetRepo(build.RepoID)
|
repo, err := s.store.GetRepo(build.RepoID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error: cannot find repo with id %d: %s", build.RepoID, err)
|
log.Printf("error: cannot find repo with id %d: %s", build.RepoID, err)
|
||||||
|
@ -209,14 +217,6 @@ func (s *RPC) Upload(c context.Context, id string, file *rpc.File) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
metadata, ok := metadata.FromContext(c)
|
|
||||||
if ok {
|
|
||||||
hostname, ok := metadata["hostname"]
|
|
||||||
if ok && len(hostname) != 0 {
|
|
||||||
proc.Machine = hostname[0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if file.Mime == "application/json+logs" {
|
if file.Mime == "application/json+logs" {
|
||||||
return s.store.LogSave(
|
return s.store.LogSave(
|
||||||
proc,
|
proc,
|
||||||
|
|
Loading…
Reference in a new issue