From 4be09fd40734430a8f366893ef3a1f0fb80f3889 Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Tue, 5 Sep 2023 15:22:24 -0500 Subject: [PATCH] Use github.com/saracen/walker for file walk operations In some local tests w/ a slowed down filesystem, this massively cut down on the time to clean up a repository by ~3x, bringing a total 'publish update' time from ~16s to ~13s. Signed-off-by: Ryan Gonzalez --- api/files.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/api/files.go b/api/files.go index 2d042a5d..f848d888 100644 --- a/api/files.go +++ b/api/files.go @@ -170,11 +170,7 @@ func apiFilesListFiles(c *gin.Context) { listLock := &sync.Mutex{} root := filepath.Join(context.UploadPath(), utils.SanitizePath(c.Params.ByName("dir"))) - err := filepath.Walk(root, func(path string, _ os.FileInfo, err error) error { - if err != nil { - return err - } - + err := walker.Walk(root, func(path string, info os.FileInfo) error { if path == root { return nil }