mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-10 22:08:48 +01:00
Nit: use time.Durations instead of constants in seconds. (#7438)
Nit: use `time.Durations` instead of constants in seconds. Makes for slightly more readable code.
This commit is contained in:
1 parent
f4f2718ba0
commit
f466ff1412
7 files changed
+20
-14
No files matched your search
@@ -1,9 +1,11 @@
|
||||
package shell
|
||||
|
||||
import (
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
|
||||
)
|
||||
|
||||
type testCommandVolumeCheckDisk struct {
|
||||
@@ -65,7 +67,8 @@ func TestShouldSkipVolume(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for num, tt := range tests {
|
||||
if isShould := cmdVolumeCheckDisk.shouldSkipVolume(&tt.a, &tt.b, tt.pulseTimeAtSecond, true, true); isShould != tt.shouldSkipVolume {
|
||||
pulseTime := time.Unix(tt.pulseTimeAtSecond, 0)
|
||||
if isShould := cmdVolumeCheckDisk.shouldSkipVolume(&tt.a, &tt.b, pulseTime, true, true); isShould != tt.shouldSkipVolume {
|
||||
t.Fatalf("result of should skip volume is unexpected for %d test", num)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user