♻️ 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
|
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 {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
info, err := entry.Info()
|
out = append(out, f)
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
out = append(out, &domain.File{
|
|
||||||
Path: filepath.Join(d, info.Name()),
|
|
||||||
Updated: info.ModTime(),
|
|
||||||
Content: content,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return out, len(out), nil
|
return out, len(out), nil
|
||||||
|
|
Loading…
Reference in New Issue