aboutsummaryrefslogtreecommitdiff
path: root/weed/server/common.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-11-22 13:45:29 -0800
committerChris Lu <chris.lu@gmail.com>2018-11-22 13:45:29 -0800
commite12b6c030641a96ee5c7575d7f98199784a6a54b (patch)
tree7470145cbb47459d6a7fd75bd3ac6720eef61393 /weed/server/common.go
parent0ed816d4e9a7dc33f4ebc9286ff7f2d069f8f1bd (diff)
downloadseaweedfs-e12b6c030641a96ee5c7575d7f98199784a6a54b.tar.xz
seaweedfs-e12b6c030641a96ee5c7575d7f98199784a6a54b.zip
add subimit count parameter
related to https://github.com/chrislusf/seaweedfs/issues/631
Diffstat (limited to 'weed/server/common.go')
-rw-r--r--weed/server/common.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/weed/server/common.go b/weed/server/common.go
index f1f2e4e4f..005424f6d 100644
--- a/weed/server/common.go
+++ b/weed/server/common.go
@@ -99,8 +99,16 @@ func submitForClientHandler(w http.ResponseWriter, r *http.Request, masterUrl st
debug("assigning file id for", fname)
r.ParseForm()
+ count := uint64(1)
+ if r.FormValue("count") != "" {
+ count, pe = strconv.ParseUint(r.FormValue("count"), 10, 32)
+ if pe != nil {
+ writeJsonError(w, r, http.StatusBadRequest, pe)
+ return
+ }
+ }
ar := &operation.VolumeAssignRequest{
- Count: 1,
+ Count: count,
Replication: r.FormValue("replication"),
Collection: r.FormValue("collection"),
Ttl: r.FormValue("ttl"),