Skip to content

Commit

Permalink
disable repair fileinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
sjqzhang committed Feb 23, 2019
1 parent 625242c commit 842f0ef
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions fileserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ func (this *Server) RepairStat() {
log.Warn("Lock RepairStat")
return
}

this.lockMap.LockKey("RepairStat")
defer this.lockMap.UnLockKey("RepairStat")

Expand Down Expand Up @@ -1620,6 +1620,11 @@ func (this *Server) saveFileMd5Log(fileInfo *FileInfo, filename string) {
}
}()

if fileInfo == nil || fileInfo.Md5 == "" || filename == "" {
log.Warn("saveFileMd5Log", fileInfo, filename)
return
}

logDate = this.util.GetDayFromTimeStamp(fileInfo.TimeStamp)

sumKey = fmt.Sprintf("%s_%s", logDate, filename)
Expand Down Expand Up @@ -2855,6 +2860,7 @@ func (this *Server) RepairStatWeb(w http.ResponseWriter, r *http.Request) {
)
this.RepairStat()
result.Status = "ok"

w.Write([]byte(this.util.JsonEncodePretty(result)))

}
Expand Down Expand Up @@ -3273,8 +3279,9 @@ func (this *Server) RepairFileInfo(w http.ResponseWriter, r *http.Request) {
return
}
result.Status = "ok"
result.Message = "repair job start,don't try again"
go this.RepairFileInfoFromFile()
//result.Message = "repair job start,don't try again"
result.Message = "very danger , disable by system"
//go this.RepairFileInfoFromFile()
w.Write([]byte(this.util.JsonEncodePretty(result)))
}

Expand Down

0 comments on commit 842f0ef

Please sign in to comment.