fix decompressing for http
This commit is contained in:
parent
a8f2db71b4
commit
2b86c283ec
3 changed files with 53 additions and 29 deletions
|
|
@ -75,7 +75,6 @@ func (api *API) ServeV1WriteNQuad(w http.ResponseWriter, r *http.Request, params
|
|||
glog.Errorln(err)
|
||||
return jsonResponse(w, 500, "Couldn't read file: "+err.Error())
|
||||
}
|
||||
|
||||
defer formFile.Close()
|
||||
|
||||
blockSize, blockErr := strconv.ParseInt(r.URL.Query().Get("block_size"), 10, 64)
|
||||
|
|
@ -83,8 +82,9 @@ func (api *API) ServeV1WriteNQuad(w http.ResponseWriter, r *http.Request, params
|
|||
blockSize = int64(api.config.LoadSize)
|
||||
}
|
||||
|
||||
quadReader, err := quad.Decompressor(formFile)
|
||||
// TODO(kortschak) Make this configurable from the web UI.
|
||||
dec := cquads.NewDecoder(formFile)
|
||||
dec := cquads.NewDecoder(quadReader)
|
||||
|
||||
h, err := api.GetHandleForRequest(r)
|
||||
if err != nil {
|
||||
|
|
@ -101,7 +101,7 @@ func (api *API) ServeV1WriteNQuad(w http.ResponseWriter, r *http.Request, params
|
|||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
panic("what can do this here?") // FIXME(kortschak)
|
||||
glog.Fatalln("what can do this here?", err) // FIXME(kortschak)
|
||||
}
|
||||
block = append(block, t)
|
||||
n++
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue