Browse Source

fix compilation error

pull/702/head
Chris Lu 7 years ago
parent
commit
cfbfc7cb67
  1. 2
      weed/operation/delete_content.go
  2. 4
      weed/wdclient/masterclient.go
  3. 6
      weed/wdclient/vid_map.go

2
weed/operation/delete_content.go

@ -22,7 +22,7 @@ type DeleteResult struct {
} }
func DeleteFromVolumeServer(fileUrlOnVolume string, jwt security.EncodedJwt) error { func DeleteFromVolumeServer(fileUrlOnVolume string, jwt security.EncodedJwt) error {
err = util.Delete(fileUrlOnVolume, jwt)
err := util.Delete(fileUrlOnVolume, jwt)
if err != nil { if err != nil {
return fmt.Errorf("Failed to delete %s:%v", fileUrlOnVolume, err) return fmt.Errorf("Failed to delete %s:%v", fileUrlOnVolume, err)
} }

4
weed/wdclient/masterclient.go

@ -68,10 +68,10 @@ func (mc *MasterClient) tryAllMasters() {
PublicUrl: volumeLocation.PublicUrl, PublicUrl: volumeLocation.PublicUrl,
} }
for _, newVid := range volumeLocation.NewVids { for _, newVid := range volumeLocation.NewVids {
mc.AddLocation(newVid, loc)
mc.addLocation(newVid, loc)
} }
for _, deletedVid := range volumeLocation.DeletedVids { for _, deletedVid := range volumeLocation.DeletedVids {
mc.DeleteLocation(deletedVid, loc)
mc.deleteLocation(deletedVid, loc)
} }
} }
} }

6
weed/wdclient/vid_map.go

@ -40,7 +40,7 @@ func (vc *VidMap) LookupFileId(fileId string) (fullUrl string, err error) {
if len(parts) != 2 { if len(parts) != 2 {
return "", errors.New("Invalid fileId " + fileId) return "", errors.New("Invalid fileId " + fileId)
} }
serverUrl, lookupError := LookupVolumeServerUrl(parts[0])
serverUrl, lookupError := vc.LookupVolumeServerUrl(parts[0])
if lookupError != nil { if lookupError != nil {
return "", lookupError return "", lookupError
} }
@ -54,7 +54,7 @@ func (vc *VidMap) GetLocations(vid uint32) (locations []Location) {
return vc.vid2Locations[vid] return vc.vid2Locations[vid]
} }
func (vc *VidMap) AddLocation(vid uint32, location Location) {
func (vc *VidMap) addLocation(vid uint32, location Location) {
vc.Lock() vc.Lock()
defer vc.Unlock() defer vc.Unlock()
@ -74,7 +74,7 @@ func (vc *VidMap) AddLocation(vid uint32, location Location) {
} }
func (vc *VidMap) DeleteLocation(vid uint32, location Location) {
func (vc *VidMap) deleteLocation(vid uint32, location Location) {
vc.Lock() vc.Lock()
defer vc.Unlock() defer vc.Unlock()

Loading…
Cancel
Save