From 71a8c80f6ff5ceaedd72ca331487d800745c5723 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 17 Oct 2021 01:04:19 -0700 Subject: [PATCH] s3: continuously listen to file updates fix https://github.com/chrislusf/seaweedfs/issues/2342 --- weed/s3api/auth_credentials_subscribe.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/weed/s3api/auth_credentials_subscribe.go b/weed/s3api/auth_credentials_subscribe.go index 05cce632a..dac1343e0 100644 --- a/weed/s3api/auth_credentials_subscribe.go +++ b/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 }) }