Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

ensure to call line.Close()

Chris Lu90677e1097e1
diff --git a/weed/shell/shell_liner.go b/weed/shell/shell_liner.go
index d79f670321..1dd611ca5e 100644
--- a/weed/shell/shell_liner.go
+++ b/weed/shell/shell_liner.go
@@ -2,6 +2,7 @@ package shell
import (
"fmt"
+ "github.com/chrislusf/seaweedfs/weed/util/grace"
"io"
"os"
"path"
@@ -25,6 +26,9 @@ func RunShell(options ShellOptions) {
line = liner.NewLiner()
defer line.Close()
+ grace.OnInterrupt(func() {
+ line.Close()
+ })
line.SetCtrlCAborts(true)