mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
commit
2c40f56e5a
|
@ -2,7 +2,9 @@ FROM frolvlad/alpine-glibc as builder
|
|||
RUN apk add git go g++
|
||||
RUN mkdir -p /go/src/github.com/chrislusf/
|
||||
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs
|
||||
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed && go install
|
||||
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \
|
||||
&& export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \
|
||||
&& go install -ldflags "${LDFLAGS}"
|
||||
|
||||
FROM alpine AS final
|
||||
LABEL author="Chris Lu"
|
||||
|
|
|
@ -2,7 +2,9 @@ FROM frolvlad/alpine-glibc as builder
|
|||
RUN apk add git go g++
|
||||
RUN mkdir -p /go/src/github.com/chrislusf/
|
||||
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs
|
||||
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed && go install -tags 5BytesOffset
|
||||
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \
|
||||
&& export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \
|
||||
&& go install -tags 5BytesOffset -ldflags "${LDFLAGS}"
|
||||
|
||||
FROM alpine AS final
|
||||
LABEL author="Chris Lu"
|
||||
|
|
|
@ -65,6 +65,6 @@ func (wfs *WFS) saveDataAsChunk(dir string) filer.SaveDataAsChunkFunctionType {
|
|||
wfs.chunkCache.SetChunk(fileId, data)
|
||||
|
||||
chunk = uploadResult.ToPbFileChunk(fileId, offset)
|
||||
return chunk, "", "", nil
|
||||
return chunk, collection, replication, nil
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,6 +139,7 @@ func (fs *FilerServer) detectCollection(requestURI, qCollection, qReplication st
|
|||
}
|
||||
|
||||
// required by buckets folder
|
||||
bucketDefaultReplication := ""
|
||||
if strings.HasPrefix(requestURI, fs.filer.DirBucketsPath+"/") {
|
||||
bucketAndObjectKey := requestURI[len(fs.filer.DirBucketsPath)+1:]
|
||||
t := strings.Index(bucketAndObjectKey, "/")
|
||||
|
@ -148,7 +149,10 @@ func (fs *FilerServer) detectCollection(requestURI, qCollection, qReplication st
|
|||
if t > 0 {
|
||||
collection = bucketAndObjectKey[:t]
|
||||
}
|
||||
replication, fsync = fs.filer.ReadBucketOption(collection)
|
||||
bucketDefaultReplication, fsync = fs.filer.ReadBucketOption(collection)
|
||||
}
|
||||
if replication == "" {
|
||||
replication = bucketDefaultReplication
|
||||
}
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue