Convert file not exists to status not found
Fixes message on pull about a statuses not being found. These statuses can just be ignored since they are no longer valid and holding the database lock while reading statuses is not necessary. Closes #1231 Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
parent
d4349eff39
commit
ccbb035231
@ -206,11 +206,17 @@ func (s *store) status(ingestPath string) (content.Status, error) {
|
|||||||
dp := filepath.Join(ingestPath, "data")
|
dp := filepath.Join(ingestPath, "data")
|
||||||
fi, err := os.Stat(dp)
|
fi, err := os.Stat(dp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
err = errors.Wrap(errdefs.ErrNotFound, err.Error())
|
||||||
|
}
|
||||||
return content.Status{}, err
|
return content.Status{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ref, err := readFileString(filepath.Join(ingestPath, "ref"))
|
ref, err := readFileString(filepath.Join(ingestPath, "ref"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
err = errors.Wrap(errdefs.ErrNotFound, err.Error())
|
||||||
|
}
|
||||||
return content.Status{}, err
|
return content.Status{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user