Replaced uint32 with uint64

This commit is contained in:
Seednode 2023-09-11 20:02:52 -05:00
parent 93799e16fe
commit 04ef12c19a
3 changed files with 22 additions and 22 deletions

View File

@ -117,9 +117,9 @@ Flags:
-f, --filter enable filtering -f, --filter enable filtering
-h, --help help for roulette -h, --help help for roulette
--images enable support for image files (default true) --images enable support for image files (default true)
--maximum-files uint32 skip directories with file counts over this value (default 4294967295) --maximum-files uint skip directories with file counts above this value (default 18446744073709551615)
--minimum-files uint32 skip directories with file counts under this value --minimum-files uint skip directories with file counts below this value (default 1)
--page-length uint16 pagination length for statistics and debug pages --page-length uint pagination length for statistics and debug pages
-p, --port uint16 port to listen on (default 8080) -p, --port uint16 port to listen on (default 8080)
--profile register net/http/pprof handlers --profile register net/http/pprof handlers
-r, --recursive recurse into subdirectories -r, --recursive recurse into subdirectories
@ -128,7 +128,7 @@ Flags:
-s, --sort enable sorting -s, --sort enable sorting
--stats expose stats endpoint --stats expose stats endpoint
--stats-file string path to optional persistent stats file --stats-file string path to optional persistent stats file
--text enable support for text files (default true) --text enable support for text files
-v, --verbose log accessed files to stdout -v, --verbose log accessed files to stdout
-V, --version display version and exit -V, --version display version and exit
--video enable support for video files --video enable support for video files

View File

@ -47,10 +47,10 @@ func (f *Files) Append(directory, path string) {
} }
type ScanStats struct { type ScanStats struct {
filesMatched atomic.Uint32 filesMatched atomic.Uint64
filesSkipped atomic.Uint32 filesSkipped atomic.Uint64
directoriesMatched atomic.Uint32 directoriesMatched atomic.Uint64
directoriesSkipped atomic.Uint32 directoriesSkipped atomic.Uint64
} }
type Path struct { type Path struct {
@ -355,9 +355,9 @@ func pathHasSupportedFiles(path string, registeredFormats *formats.SupportedForm
} }
} }
func pathCount(path string) (uint32, uint32, error) { func pathCount(path string) (uint64, uint64, error) {
var directories uint32 = 0 var directories uint64 = 0
var files uint32 = 0 var files uint64 = 0
nodes, err := os.ReadDir(path) nodes, err := os.ReadDir(path)
if err != nil { if err != nil {
@ -449,10 +449,10 @@ func fileList(paths []string, filters *Filters, sort string, index *Index, types
} }
stats := &ScanStats{ stats := &ScanStats{
filesMatched: atomic.Uint32{}, filesMatched: atomic.Uint64{},
filesSkipped: atomic.Uint32{}, filesSkipped: atomic.Uint64{},
directoriesMatched: atomic.Uint32{}, directoriesMatched: atomic.Uint64{},
directoriesSkipped: atomic.Uint32{}, directoriesSkipped: atomic.Uint64{},
} }
concurrency := &Concurrency{ concurrency := &Concurrency{

View File

@ -12,7 +12,7 @@ import (
) )
const ( const (
Version string = "0.69.1" Version string = "0.69.2"
) )
var ( var (
@ -24,9 +24,9 @@ var (
debug bool debug bool
filtering bool filtering bool
images bool images bool
maximumFileCount uint32 maximumFileCount uint64
minimumFileCount uint32 minimumFileCount uint64
pageLength uint16 pageLength uint64
port uint16 port uint16
profile bool profile bool
recursive bool recursive bool
@ -83,9 +83,9 @@ func init() {
rootCmd.Flags().BoolVarP(&debug, "debug", "d", false, "expose debug endpoint") rootCmd.Flags().BoolVarP(&debug, "debug", "d", false, "expose debug endpoint")
rootCmd.Flags().BoolVarP(&filtering, "filter", "f", false, "enable filtering") rootCmd.Flags().BoolVarP(&filtering, "filter", "f", false, "enable filtering")
rootCmd.Flags().BoolVar(&images, "images", true, "enable support for image files") rootCmd.Flags().BoolVar(&images, "images", true, "enable support for image files")
rootCmd.Flags().Uint32Var(&maximumFileCount, "maximum-files", 1<<32-1, "skip directories with file counts over this value") rootCmd.Flags().Uint64Var(&maximumFileCount, "maximum-files", 1<<64-1, "skip directories with file counts above this value")
rootCmd.Flags().Uint32Var(&minimumFileCount, "minimum-files", 0, "skip directories with file counts under this value") rootCmd.Flags().Uint64Var(&minimumFileCount, "minimum-files", 1, "skip directories with file counts below this value")
rootCmd.Flags().Uint16Var(&pageLength, "page-length", 0, "pagination length for statistics and debug pages") rootCmd.Flags().Uint64Var(&pageLength, "page-length", 0, "pagination length for statistics and debug pages")
rootCmd.Flags().Uint16VarP(&port, "port", "p", 8080, "port to listen on") rootCmd.Flags().Uint16VarP(&port, "port", "p", 8080, "port to listen on")
rootCmd.Flags().BoolVar(&profile, "profile", false, "register net/http/pprof handlers") rootCmd.Flags().BoolVar(&profile, "profile", false, "register net/http/pprof handlers")
rootCmd.Flags().BoolVarP(&recursive, "recursive", "r", false, "recurse into subdirectories") rootCmd.Flags().BoolVarP(&recursive, "recursive", "r", false, "recurse into subdirectories")