Massive code cleanup (#10913)

* Massive code cleanup

* fix test issues

* remove GetGenesis mock expectations

* unused receiver

* rename unused params

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Radosław Kapka
2022-06-27 15:34:38 +02:00
committed by GitHub
parent 9216be7d43
commit 7f56ac6355
158 changed files with 1020 additions and 1177 deletions

View File

@@ -116,11 +116,10 @@ func main() {
}
func printBucketStats(dbNameWithPath string) {
ctx := context.Background()
groupSize := uint64(128)
doneC := make(chan bool)
statsC := make(chan *bucketStat, groupSize)
go readBucketStat(ctx, dbNameWithPath, statsC)
go readBucketStat(dbNameWithPath, statsC)
go printBucketStat(statsC, doneC)
<-doneC
}
@@ -163,7 +162,7 @@ func printBucketContents(dbNameWithPath string, rowLimit uint64, bucketName stri
<-doneC
}
func readBucketStat(ctx context.Context, dbNameWithPath string, statsC chan<- *bucketStat) {
func readBucketStat(dbNameWithPath string, statsC chan<- *bucketStat) {
// open the raw database file. If the file is busy, then exit.
db, openErr := bolt.Open(dbNameWithPath, 0600, &bolt.Options{Timeout: 1 * time.Second})
if openErr != nil {