Skip to content

Commit

Permalink
Merge pull request #269 from jaredbischof/master
Browse files Browse the repository at this point in the history
Pulling down Shock node parts information inside of Lock so that ther…
  • Loading branch information
teharrison committed May 19, 2015
2 parents da8335a + 760c0f2 commit a40db4f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions shock-server/node/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,16 @@ func (node *Node) Update(params map[string]string, files FormFiles) (err error)
return errors.New("This is not a parts node and thus does not support uploading in parts.")
}
LockMgr.LockPartOp()

// Refresh parts information after locking, before saving.
// Load node by id
n, err := Load(node.Id)
if err != nil {
LockMgr.UnlockPartOp()
return err
}
node.Parts = n.Parts

if node.Parts.Count > 0 || node.Parts.VarLen {
for key, file := range files {
keyn, errf := strconv.Atoi(key)
Expand Down

0 comments on commit a40db4f

Please sign in to comment.