♻️ Use Get method in Fetch of static repository
This commit is contained in:
parent
fc4e5281a8
commit
56ddbcce4f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue