correct sequence generating

git-svn-id: https://weed-fs.googlecode.com/svn/trunk@30 282b0af5-e82d-9cf1-ede4-77906d7719d0
This commit is contained in:
chris.lu@gmail.com 2011-12-27 06:09:21 +00:00
parent b2f4a4e739
commit 60c17068a6
2 changed files with 5 additions and 2 deletions

View file

@ -43,7 +43,9 @@ func dirJoinHandler(w http.ResponseWriter, r *http.Request) {
publicUrl := r.FormValue("publicUrl") publicUrl := r.FormValue("publicUrl")
volumes := new([]storage.VolumeInfo) volumes := new([]storage.VolumeInfo)
json.Unmarshal([]byte(r.FormValue("volumes")), volumes) json.Unmarshal([]byte(r.FormValue("volumes")), volumes)
if *IsDebug {
log.Println(s, "volumes", r.FormValue("volumes")) log.Println(s, "volumes", r.FormValue("volumes"))
}
mapper.Add(*directory.NewMachine(s, publicUrl, *volumes)) mapper.Add(*directory.NewMachine(s, publicUrl, *volumes))
} }
func dirStatusHandler(w http.ResponseWriter, r *http.Request) { func dirStatusHandler(w http.ResponseWriter, r *http.Request) {

View file

@ -69,6 +69,7 @@ func (m *Mapper) PickForWrite() (string, MachineInfo) {
func (m *Mapper) NextFileId() uint64 { func (m *Mapper) NextFileId() uint64 {
if m.fileIdCounter <= 0 { if m.fileIdCounter <= 0 {
m.fileIdCounter = FileIdSaveInterval m.fileIdCounter = FileIdSaveInterval
m.FileIdSequence += FileIdSaveInterval
m.saveSequence() m.saveSequence()
} }
m.fileIdCounter-- m.fileIdCounter--