fix big upload

This commit is contained in:
sjqzhang 2022-03-01 15:18:57 +08:00
parent b620ed0a20
commit 87b7cf0643
2 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash
BIN_VERSION="go-fastdfs:${1-$(git describe --tags `git rev-parse HEAD`)}"
if [[ ! -d src ]];then
@ -15,6 +17,13 @@ mkdir -p src/github.com/sjqzhang/go-fastdfs
cp -rf cmd doc server main.go src/github.com/sjqzhang/go-fastdfs
GOPATH=`pwd` GOARCH=amd64 go test -v server/*.go
if [[ $? -ne 0 ]];then
echo "test fail"
exit 1
fi
#for linux
GOPATH=`pwd` GOOS=linux GOARCH=amd64 go build -o fileserver -ldflags "-w -s -X 'main.VERSION=$BIN_VERSION' -X 'main.BUILD_TIME=build_time:`date`' -X 'main.GO_VERSION=`go version`' -X 'main.GIT_VERSION=git_version:`git rev-parse HEAD`'" src/github.com/sjqzhang/go-fastdfs/main.go
GOPATH=`pwd` GOOS=linux GOARCH=386 go build -o fileserver32 -ldflags "-w -s -X 'main.VERSION=$BIN_VERSION' -X 'main.BUILD_TIME=build_time:`date`' -X 'main.GO_VERSION=`go version`' -X 'main.GIT_VERSION=git_version:`git rev-parse HEAD`'" src/github.com/sjqzhang/go-fastdfs/main.go

View File

@ -272,12 +272,13 @@ func (c *Server) initComponent(isReload bool) {
}
}
Config().Peers = peers
if Config().EnablePprofDebug {
mux = http.DefaultServeMux
} else {
mux = http.NewServeMux()
}
if !isReload {
if Config().EnablePprofDebug {
mux = http.DefaultServeMux
} else {
mux = http.NewServeMux()
}
c.FormatStatInfo()
if Config().EnableTus {
c.initTus()