breaks dependency loop
This commit is contained in:
@@ -19,7 +19,7 @@ import (
|
||||
func (fs *FilerServer) LookupDirectoryEntry(ctx context.Context, req *filer_pb.LookupDirectoryEntryRequest) (*filer_pb.LookupDirectoryEntryResponse, error) {
|
||||
|
||||
entry, err := fs.filer.FindEntry(ctx, filer2.FullPath(filepath.ToSlash(filepath.Join(req.Directory, req.Name))))
|
||||
if err == filer2.ErrNotFound {
|
||||
if err == filer_pb.ErrNotFound {
|
||||
return &filer_pb.LookupDirectoryEntryResponse{}, nil
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/filer2"
|
||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||
"github.com/chrislusf/seaweedfs/weed/stats"
|
||||
"github.com/chrislusf/seaweedfs/weed/util"
|
||||
)
|
||||
@@ -33,7 +34,7 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
|
||||
fs.listDirectoryHandler(w, r)
|
||||
return
|
||||
}
|
||||
if err == filer2.ErrNotFound {
|
||||
if err == filer_pb.ErrNotFound {
|
||||
glog.V(1).Infof("Not found %s: %v", path, err)
|
||||
stats.FilerRequestCounter.WithLabelValues("read.notfound").Inc()
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
|
||||
@@ -307,7 +307,7 @@ func (fs *FilerServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {
|
||||
if err != nil {
|
||||
glog.V(1).Infoln("deleting", r.URL.Path, ":", err.Error())
|
||||
httpStatus := http.StatusInternalServerError
|
||||
if err == filer2.ErrNotFound {
|
||||
if err == filer_pb.ErrNotFound {
|
||||
httpStatus = http.StatusNotFound
|
||||
}
|
||||
writeJsonError(w, r, httpStatus, err)
|
||||
|
||||
Reference in New Issue
Block a user