add capability to assign a batch of file ids

git-svn-id: https://weed-fs.googlecode.com/svn/trunk@50 282b0af5-e82d-9cf1-ede4-77906d7719d0
This commit is contained in:
chris.lu@gmail.com
2012-07-16 04:12:42 +00:00
parent 74989d69c9
commit 68a216586f
2 changed files with 28 additions and 13 deletions

View File

@@ -37,9 +37,10 @@ func dirLookupHandler(w http.ResponseWriter, r *http.Request) {
}
}
func dirAssignHandler(w http.ResponseWriter, r *http.Request) {
fid, machine, err := mapper.PickForWrite()
c:=r.FormValue("count")
fid, count, machine, err := mapper.PickForWrite(c)
if err == nil {
writeJson(w, r, map[string]string{"fid": fid, "url": machine.Url, "publicUrl":machine.PublicUrl})
writeJson(w, r, map[string]string{"fid": fid, "url": machine.Url, "publicUrl":machine.PublicUrl, "count":strconv.Itoa(count)})
} else {
log.Println(err)
writeJson(w, r, map[string]string{"error": err.Error()})