Browse Source

s3: continuously listen to file updates

fix https://github.com/chrislusf/seaweedfs/issues/2342
pull/2388/head
Chris Lu 3 years ago
parent
commit
71a8c80f6f
  1. 7
      weed/s3api/auth_credentials_subscribe.go

7
weed/s3api/auth_credentials_subscribe.go

@ -8,7 +8,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/util"
)
func (s3a *S3ApiServer) subscribeMetaEvents(clientName string, prefix string, lastTsNs int64) error {
func (s3a *S3ApiServer) subscribeMetaEvents(clientName string, prefix string, lastTsNs int64) {
processEventFn := func(resp *filer_pb.SubscribeMetadataResponse) error {
@ -32,8 +32,11 @@ func (s3a *S3ApiServer) subscribeMetaEvents(clientName string, prefix string, la
return nil
}
return util.Retry("followIamChanges", func() error {
util.RetryForever("followIamChanges", func() error {
return pb.WithFilerClientFollowMetadata(s3a, clientName, prefix, lastTsNs, 0, processEventFn, true)
}, func(err error) bool {
glog.V(0).Infof("iam follow metadata changes: %v", err)
return true
})
}
|||||||
100:0
Loading…
Cancel
Save