Replaced uint64 with uint32
This commit is contained in:
parent
77f14ea71b
commit
01629da407
30
cmd/files.go
30
cmd/files.go
|
@ -63,10 +63,10 @@ func (f *Files) Append(directory, path string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ScanStats struct {
|
type ScanStats struct {
|
||||||
filesMatched atomic.Uint64
|
filesMatched atomic.Uint32
|
||||||
filesSkipped atomic.Uint64
|
filesSkipped atomic.Uint32
|
||||||
directoriesMatched atomic.Uint64
|
directoriesMatched atomic.Uint32
|
||||||
directoriesSkipped atomic.Uint64
|
directoriesSkipped atomic.Uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
type Path struct {
|
type Path struct {
|
||||||
|
@ -155,7 +155,7 @@ func appendPath(directory, path string, files *Files, stats *ScanStats, shouldCa
|
||||||
|
|
||||||
files.Append(directory, path)
|
files.Append(directory, path)
|
||||||
|
|
||||||
stats.filesMatched.Add(uint64(1))
|
stats.filesMatched.Add(1)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -415,9 +415,9 @@ func pathHasSupportedFiles(path string) (bool, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func pathCount(path string) (int, int, error) {
|
func pathCount(path string) (uint32, uint32, error) {
|
||||||
directories := 0
|
var directories uint32 = 0
|
||||||
files := 0
|
var files uint32 = 0
|
||||||
|
|
||||||
nodes, err := os.ReadDir(path)
|
nodes, err := os.ReadDir(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -473,10 +473,10 @@ func scanPath(path string, files *Files, filters *Filters, stats *ScanStats, con
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if files > 0 && (files < int(minimumFileCount) || files > int(maximumFileCount)) {
|
if files > 0 && (files < minimumFileCount) || (files > maximumFileCount) {
|
||||||
// This count will not otherwise include the parent directory itself, so increment by one
|
// This count will not otherwise include the parent directory itself, so increment by one
|
||||||
stats.directoriesSkipped.Add(uint64(directories + 1))
|
stats.directoriesSkipped.Add(directories + 1)
|
||||||
stats.filesSkipped.Add(uint64(files))
|
stats.filesSkipped.Add(files)
|
||||||
|
|
||||||
return filepath.SkipDir
|
return filepath.SkipDir
|
||||||
}
|
}
|
||||||
|
@ -509,10 +509,10 @@ func fileList(paths []string, filters *Filters, sort string, index *Index) ([]st
|
||||||
}
|
}
|
||||||
|
|
||||||
stats := &ScanStats{
|
stats := &ScanStats{
|
||||||
filesMatched: atomic.Uint64{},
|
filesMatched: atomic.Uint32{},
|
||||||
filesSkipped: atomic.Uint64{},
|
filesSkipped: atomic.Uint32{},
|
||||||
directoriesMatched: atomic.Uint64{},
|
directoriesMatched: atomic.Uint32{},
|
||||||
directoriesSkipped: atomic.Uint64{},
|
directoriesSkipped: atomic.Uint32{},
|
||||||
}
|
}
|
||||||
|
|
||||||
concurrency := &Concurrency{
|
concurrency := &Concurrency{
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version string = "0.56.0"
|
Version string = "0.56.1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
12
cmd/web.go
12
cmd/web.go
|
@ -171,14 +171,14 @@ func (i *Index) Import(path string) error {
|
||||||
type ServeStats struct {
|
type ServeStats struct {
|
||||||
mutex sync.RWMutex
|
mutex sync.RWMutex
|
||||||
list []string
|
list []string
|
||||||
count map[string]uint64
|
count map[string]uint32
|
||||||
size map[string]string
|
size map[string]string
|
||||||
times map[string][]string
|
times map[string][]string
|
||||||
}
|
}
|
||||||
|
|
||||||
type exportedServeStats struct {
|
type exportedServeStats struct {
|
||||||
List []string
|
List []string
|
||||||
Count map[string]uint64
|
Count map[string]uint32
|
||||||
Size map[string]string
|
Size map[string]string
|
||||||
Times map[string][]string
|
Times map[string][]string
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ func (s *ServeStats) incrementCounter(image string, timestamp time.Time, filesiz
|
||||||
func (s *ServeStats) toExported() *exportedServeStats {
|
func (s *ServeStats) toExported() *exportedServeStats {
|
||||||
stats := &exportedServeStats{
|
stats := &exportedServeStats{
|
||||||
List: make([]string, len(s.list)),
|
List: make([]string, len(s.list)),
|
||||||
Count: make(map[string]uint64),
|
Count: make(map[string]uint32),
|
||||||
Size: make(map[string]string),
|
Size: make(map[string]string),
|
||||||
Times: make(map[string][]string),
|
Times: make(map[string][]string),
|
||||||
}
|
}
|
||||||
|
@ -316,7 +316,7 @@ func (s *ServeStats) Import(path string) error {
|
||||||
|
|
||||||
stats := &exportedServeStats{
|
stats := &exportedServeStats{
|
||||||
List: []string{},
|
List: []string{},
|
||||||
Count: make(map[string]uint64),
|
Count: make(map[string]uint32),
|
||||||
Size: make(map[string]string),
|
Size: make(map[string]string),
|
||||||
Times: make(map[string][]string),
|
Times: make(map[string][]string),
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ func (s *ServeStats) Import(path string) error {
|
||||||
|
|
||||||
type timesServed struct {
|
type timesServed struct {
|
||||||
File string
|
File string
|
||||||
Served uint64
|
Served uint32
|
||||||
Size string
|
Size string
|
||||||
Times []string
|
Times []string
|
||||||
}
|
}
|
||||||
|
@ -1013,7 +1013,7 @@ func ServePage(args []string) error {
|
||||||
stats := &ServeStats{
|
stats := &ServeStats{
|
||||||
mutex: sync.RWMutex{},
|
mutex: sync.RWMutex{},
|
||||||
list: []string{},
|
list: []string{},
|
||||||
count: make(map[string]uint64),
|
count: make(map[string]uint32),
|
||||||
size: make(map[string]string),
|
size: make(map[string]string),
|
||||||
times: make(map[string][]string),
|
times: make(map[string][]string),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue