mirror of https://github.com/minio/minio.git
parent
5f7e6d03ff
commit
aca6dfbd60
|
@ -199,6 +199,7 @@ func (z *erasureServerPools) listPath(ctx context.Context, o *listPathOptions) (
|
||||||
entries.truncate(0)
|
entries.truncate(0)
|
||||||
go func() {
|
go func() {
|
||||||
rpc := globalNotificationSys.restClientFromHash(o.Bucket)
|
rpc := globalNotificationSys.restClientFromHash(o.Bucket)
|
||||||
|
if rpc != nil {
|
||||||
ctx, cancel := context.WithTimeout(GlobalContext, 5*time.Second)
|
ctx, cancel := context.WithTimeout(GlobalContext, 5*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
c, err := rpc.GetMetacacheListing(ctx, *o)
|
c, err := rpc.GetMetacacheListing(ctx, *o)
|
||||||
|
@ -207,6 +208,7 @@ func (z *erasureServerPools) listPath(ctx context.Context, o *listPathOptions) (
|
||||||
c.status = scanStateError
|
c.status = scanStateError
|
||||||
rpc.UpdateMetacacheListing(ctx, *c)
|
rpc.UpdateMetacacheListing(ctx, *c)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
o.ID = ""
|
o.ID = ""
|
||||||
|
|
||||||
|
|
|
@ -720,6 +720,11 @@ func (client *peerRESTClient) GetLocalDiskIDs(ctx context.Context) (diskIDs []st
|
||||||
|
|
||||||
// GetMetacacheListing - get a new or existing metacache.
|
// GetMetacacheListing - get a new or existing metacache.
|
||||||
func (client *peerRESTClient) GetMetacacheListing(ctx context.Context, o listPathOptions) (*metacache, error) {
|
func (client *peerRESTClient) GetMetacacheListing(ctx context.Context, o listPathOptions) (*metacache, error) {
|
||||||
|
if client == nil {
|
||||||
|
resp := localMetacacheMgr.getBucket(ctx, o.Bucket).findCache(o)
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
var reader bytes.Buffer
|
var reader bytes.Buffer
|
||||||
err := gob.NewEncoder(&reader).Encode(o)
|
err := gob.NewEncoder(&reader).Encode(o)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -737,6 +742,9 @@ func (client *peerRESTClient) GetMetacacheListing(ctx context.Context, o listPat
|
||||||
|
|
||||||
// UpdateMetacacheListing - update an existing metacache it will unconditionally be updated to the new state.
|
// UpdateMetacacheListing - update an existing metacache it will unconditionally be updated to the new state.
|
||||||
func (client *peerRESTClient) UpdateMetacacheListing(ctx context.Context, m metacache) (metacache, error) {
|
func (client *peerRESTClient) UpdateMetacacheListing(ctx context.Context, m metacache) (metacache, error) {
|
||||||
|
if client == nil {
|
||||||
|
return localMetacacheMgr.updateCacheEntry(m)
|
||||||
|
}
|
||||||
b, err := m.MarshalMsg(nil)
|
b, err := m.MarshalMsg(nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return m, err
|
return m, err
|
||||||
|
|
Loading…
Reference in New Issue