mirror of
https://gitee.com/sjqzhang/go-fastdfs.git
synced 2024-11-30 02:07:45 +08:00
add fileserver version info
This commit is contained in:
parent
9b8871c2c1
commit
6c3f4d4f39
9
build.sh
Normal file
9
build.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
BIN_VERSION="go-fastdfs:${1-not set}"
|
||||
|
||||
|
||||
go build -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`'" fileserver.go
|
||||
GOOS=windows go build -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`'" fileserver.go
|
||||
|
||||
|
@ -53,6 +53,13 @@ var server *Server
|
||||
var logacc log.LoggerInterface
|
||||
var FOLDERS = []string{DATA_DIR, STORE_DIR, CONF_DIR, STATIC_DIR}
|
||||
var CONST_QUEUE_SIZE = 10000
|
||||
var (
|
||||
VERSION string
|
||||
BUILD_TIME string
|
||||
GO_VERSION string
|
||||
GIT_VERSION string
|
||||
v = flag.Bool("v", false, "display version")
|
||||
)
|
||||
var (
|
||||
FileName string
|
||||
ptr unsafe.Pointer
|
||||
@ -3599,6 +3606,10 @@ func (HttpHandler) ServeHTTP(res http.ResponseWriter, req *http.Request) {
|
||||
http.DefaultServeMux.ServeHTTP(res, req)
|
||||
}
|
||||
func (this *Server) Main() {
|
||||
if *v {
|
||||
fmt.Printf("%s\n%s\n%s\n%s\n", VERSION, BUILD_TIME, GO_VERSION,GIT_VERSION)
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
for {
|
||||
this.CheckFileAndSendToPeer(this.util.GetToDay(), CONST_Md5_ERROR_FILE_NAME, false)
|
||||
|
Loading…
Reference in New Issue
Block a user