Skip to content

Commit

Permalink
Merge pull request #10 from kroexov/indexer-fix
Browse files Browse the repository at this point in the history
Fix indexer in case file not found
  • Loading branch information
sas1024 authored Jan 26, 2024
2 parents c300e36 + d37784f commit e0a4c1a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ func (hi HashIndexer) ProcessQueue(ctx context.Context) error {
list[i].IndexedAt = &now
info, err := hi.IndexFile(ns, NewFileHash(v.Hash, v.Extension).File())
if err != nil {
if errors.Is(err, os.ErrNotExist) {
// skip in case file not found (not downloaded yet)
list[i].IndexedAt = nil
}
list[i].Error = err.Error()
continue
}
Expand All @@ -266,6 +270,7 @@ func (hi HashIndexer) ProcessQueue(ctx context.Context) error {
db.Columns.VfsHash.Width,
db.Columns.VfsHash.IndexedAt,
db.Columns.VfsHash.Blurhash,
db.Columns.VfsHash.Error,
).
Update()
return err
Expand Down

0 comments on commit e0a4c1a

Please sign in to comment.