diff options
| author | ARibster <caialjf@yahoo.com> | 2025-05-01 22:09:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-01 13:09:47 -0700 |
| commit | d424cbbcd5d284d7a1a6e2c671da29ca12a592c3 (patch) | |
| tree | a95f2601a5c5e0c5e7f139e402ebce76e13fb244 /weed/command/s3.go | |
| parent | 71382d32798120acb42730f5bb4435ad4be8f9f5 (diff) | |
| download | seaweedfs-d424cbbcd5d284d7a1a6e2c671da29ca12a592c3.tar.xz seaweedfs-d424cbbcd5d284d7a1a6e2c671da29ca12a592c3.zip | |
fix: S3 Feature: please add s3.idleTimeout command line parameter #6746 (#6747)
ildeTimeout command line parameter for s3
Diffstat (limited to 'weed/command/s3.go')
| -rw-r--r-- | weed/command/s3.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/weed/command/s3.go b/weed/command/s3.go index 84042b3e0..4f513a5fa 100644 --- a/weed/command/s3.go +++ b/weed/command/s3.go @@ -57,6 +57,7 @@ type S3Options struct { dataCenter *string localSocket *string certProvider certprovider.Provider + idleTimeout *int } func init() { @@ -81,6 +82,7 @@ func init() { s3StandaloneOptions.allowDeleteBucketNotEmpty = cmdS3.Flag.Bool("allowDeleteBucketNotEmpty", true, "allow recursive deleting all entries along with bucket") s3StandaloneOptions.localFilerSocket = cmdS3.Flag.String("localFilerSocket", "", "local filer socket path") s3StandaloneOptions.localSocket = cmdS3.Flag.String("localSocket", "", "default to /tmp/seaweedfs-s3-<port>.sock") + s3StandaloneOptions.idleTimeout = cmdS3.Flag.Int("idleTimeout", 10, "connection idle seconds") } var cmdS3 = &Command{ @@ -275,7 +277,8 @@ func (s3opt *S3Options) startS3Server() bool { } listenAddress := fmt.Sprintf("%s:%d", *s3opt.bindIp, *s3opt.port) - s3ApiListener, s3ApiLocalListener, err := util.NewIpAndLocalListeners(*s3opt.bindIp, *s3opt.port, time.Duration(10)*time.Second) + s3ApiListener, s3ApiLocalListener, err := util.NewIpAndLocalListeners( + *s3opt.bindIp, *s3opt.port, time.Duration(*s3opt.idleTimeout)*time.Second) if err != nil { glog.Fatalf("S3 API Server listener on %s error: %v", listenAddress, err) } @@ -350,7 +353,7 @@ func (s3opt *S3Options) startS3Server() bool { } else { glog.V(0).Infof("Start Seaweed S3 API Server %s at https port %d", util.Version(), *s3opt.portHttps) s3ApiListenerHttps, s3ApiLocalListenerHttps, _ := util.NewIpAndLocalListeners( - *s3opt.bindIp, *s3opt.portHttps, time.Duration(10)*time.Second) + *s3opt.bindIp, *s3opt.portHttps, time.Duration(*s3opt.idleTimeout)*time.Second) if s3ApiLocalListenerHttps != nil { go func() { if err = httpS.ServeTLS(s3ApiLocalListenerHttps, "", ""); err != nil { |
