diff options
| author | chrislu <chris.lu@gmail.com> | 2024-03-17 01:01:45 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-03-17 01:01:45 -0700 |
| commit | ca042bd067a745f5f2eda3943a98e64564f27f6a (patch) | |
| tree | dd3670fd4cbf3e187e2a2288cf6fb2f6abe1bb56 | |
| parent | 4dce1e9d29c42fd5fb08e30491eb5e6958512319 (diff) | |
| download | seaweedfs-ca042bd067a745f5f2eda3943a98e64564f27f6a.tar.xz seaweedfs-ca042bd067a745f5f2eda3943a98e64564f27f6a.zip | |
simplify
| -rw-r--r-- | weed/shell/command_volume_balance_test.go | 2 | ||||
| -rw-r--r-- | weed/shell/command_volume_tier_move.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/weed/shell/command_volume_balance_test.go b/weed/shell/command_volume_balance_test.go index ce0aeb5ab..d533269a4 100644 --- a/weed/shell/command_volume_balance_test.go +++ b/weed/shell/command_volume_balance_test.go @@ -264,7 +264,7 @@ func TestBalance(t *testing.T) { func TestVolumeSelection(t *testing.T) { topologyInfo := parseOutput(topoData) - vids, err := collectVolumeIdsForTierChange(nil, topologyInfo, 1000, types.ToDiskType("hdd"), "", 20.0, 0) + vids, err := collectVolumeIdsForTierChange(topologyInfo, 1000, types.ToDiskType("hdd"), "", 20.0, 0) if err != nil { t.Errorf("collectVolumeIdsForTierChange: %v", err) } diff --git a/weed/shell/command_volume_tier_move.go b/weed/shell/command_volume_tier_move.go index bf41c2ea0..e6cf4ee02 100644 --- a/weed/shell/command_volume_tier_move.go +++ b/weed/shell/command_volume_tier_move.go @@ -88,7 +88,7 @@ func (c *commandVolumeTierMove) Do(args []string, commandEnv *CommandEnv, writer } // collect all volumes that should change - volumeIds, err := collectVolumeIdsForTierChange(commandEnv, topologyInfo, volumeSizeLimitMb, fromDiskType, *collectionPattern, *fullPercentage, *quietPeriod) + volumeIds, err := collectVolumeIdsForTierChange(topologyInfo, volumeSizeLimitMb, fromDiskType, *collectionPattern, *fullPercentage, *quietPeriod) if err != nil { return err } @@ -279,7 +279,7 @@ func (c *commandVolumeTierMove) doMoveOneVolume(commandEnv *CommandEnv, writer i return nil } -func collectVolumeIdsForTierChange(commandEnv *CommandEnv, topologyInfo *master_pb.TopologyInfo, volumeSizeLimitMb uint64, sourceTier types.DiskType, collectionPattern string, fullPercentage float64, quietPeriod time.Duration) (vids []needle.VolumeId, err error) { +func collectVolumeIdsForTierChange(topologyInfo *master_pb.TopologyInfo, volumeSizeLimitMb uint64, sourceTier types.DiskType, collectionPattern string, fullPercentage float64, quietPeriod time.Duration) (vids []needle.VolumeId, err error) { quietSeconds := int64(quietPeriod / time.Second) nowUnixSeconds := time.Now().Unix() |
