mirror of
https://github.com/restic/restic.git
synced 2026-11-02 13:35:33 +00:00
Fix missing rand seed for restic check --read-data-subset=x%
This commit is contained in:
1 parent
cdd704920d
commit
f9e1fa26ff
1 file changed
+4
-1
@@ -5,6 +5,7 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
@@ -333,7 +334,9 @@ func selectRandomPacksByPercentage(allPacks map[restic.ID]int64, percentage floa
|
|||||||
if packsToCheck < 1 {
|
if packsToCheck < 1 {
|
||||||
packsToCheck = 1
|
packsToCheck = 1
|
||||||
}
|
}
|
||||||
idx := rand.Perm(packCount)
|
timeNs := time.Now().UnixNano()
|
||||||
|
r := rand.New(rand.NewSource(timeNs))
|
||||||
|
idx := r.Perm(packCount)
|
||||||
|
|
||||||
var keys []restic.ID
|
var keys []restic.ID
|
||||||
for k := range allPacks {
|
for k := range allPacks {
|
||||||
|
|||||||
Reference in new issue
Block a user