diff options
| author | chrislu <chris.lu@gmail.com> | 2025-07-04 13:11:43 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2025-07-04 13:11:43 -0700 |
| commit | a5f48de7d6c1a548539d7008ea467b0dc0929a7e (patch) | |
| tree | b15fdfdfbc3583253bf13f470ae47ab3b8e34efb /weed/admin/dash/admin_server.go | |
| parent | 0c1d4b2d08dece2270c58213a07cf8409b2271d8 (diff) | |
| download | seaweedfs-a5f48de7d6c1a548539d7008ea467b0dc0929a7e.tar.xz seaweedfs-a5f48de7d6c1a548539d7008ea467b0dc0929a7e.zip | |
add vacuum operation
Diffstat (limited to 'weed/admin/dash/admin_server.go')
| -rw-r--r-- | weed/admin/dash/admin_server.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/weed/admin/dash/admin_server.go b/weed/admin/dash/admin_server.go index 89bae8ea2..93b556af8 100644 --- a/weed/admin/dash/admin_server.go +++ b/weed/admin/dash/admin_server.go @@ -1389,3 +1389,15 @@ func (s *AdminServer) GetVolumeDetails(volumeID int, server string) (*VolumeDeta LastUpdated: time.Now(), }, nil } + +// VacuumVolume performs a vacuum operation on a specific volume +func (s *AdminServer) VacuumVolume(volumeID int, server string) error { + return s.WithMasterClient(func(client master_pb.SeaweedClient) error { + _, err := client.VacuumVolume(context.Background(), &master_pb.VacuumVolumeRequest{ + VolumeId: uint32(volumeID), + GarbageThreshold: 0.0001, // A very low threshold to ensure all garbage is collected + Collection: "", // Empty for all collections + }) + return err + }) +} |
