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 <ryan.gonzalez@collabora.com>
This commit is contained in:
Ryan Gonzalez
2023-09-05 15:22:24 -05:00
committed by André Roth
parent ab18da351d
commit 4be09fd407

View File

@@ -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
}