From ae8c6d95a61b6ada7f7676188aab1d81d4308df7 Mon Sep 17 00:00:00 2001 From: "steve.wei" Date: Thu, 26 Sep 2024 23:31:57 +0800 Subject: [PATCH] fix: Prevent potential metadata change events from being lost. (#6066) --- weed/s3api/s3api_server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weed/s3api/s3api_server.go b/weed/s3api/s3api_server.go index 8c2c4f8f3..9b7ee6690 100644 --- a/weed/s3api/s3api_server.go +++ b/weed/s3api/s3api_server.go @@ -51,6 +51,8 @@ type S3ApiServer struct { } func NewS3ApiServer(router *mux.Router, option *S3ApiServerOption) (s3ApiServer *S3ApiServer, err error) { + startTsNs := time.Now().UnixNano() + v := util.GetViper() signingKey := v.GetString("jwt.filer_signing.key") v.SetDefault("jwt.filer_signing.expires_after_seconds", 10) @@ -101,7 +103,7 @@ func NewS3ApiServer(router *mux.Router, option *S3ApiServerOption) (s3ApiServer s3ApiServer.registerRouter(router) - go s3ApiServer.subscribeMetaEvents("s3", time.Now().UnixNano(), filer.DirectoryEtcRoot, []string{option.BucketsPath}) + go s3ApiServer.subscribeMetaEvents("s3", startTsNs, filer.DirectoryEtcRoot, []string{option.BucketsPath}) return s3ApiServer, nil }