♻️ Use Get method in Fetch of static repository

This commit is contained in:
Maxim Lebedev 2023-11-10 03:53:47 +06:00
parent fc4e5281a8
commit 56ddbcce4f
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 2 additions and 11 deletions

View File

@ -51,21 +51,12 @@ func (repo *fileServerStaticRepository) Fetch(ctx context.Context, d string) (do
continue
}
content, err := fs.ReadFile(repo.root, filepath.Join(d, entry.Name()))
f, err := repo.Get(ctx, filepath.Join(d, entry.Name()))
if err != nil {
continue
}
info, err := entry.Info()
if err != nil {
continue
}
out = append(out, &domain.File{
Path: filepath.Join(d, info.Name()),
Updated: info.ModTime(),
Content: content,
})
out = append(out, f)
}
return out, len(out), nil