Skip to content

Commit

Permalink
Fix: IPFS queue
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Jan 17, 2022
1 parent a4d18d7 commit 6836b36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/metadata/service/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ func (s *ContractService) manager(ctx context.Context) {
continue
}

s.queue.Add(contracts[i].ID)

if ipfs.Is(contracts[i].Link) {
link, err := s.db.IPFSLinkByURL(contracts[i].Link)
if err == nil {
Expand All @@ -115,8 +117,6 @@ func (s *ContractService) manager(ctx context.Context) {
log.Err(err).Msg("contract IPFSLinkByURL")
}
}

s.queue.Add(contracts[i].ID)
s.tasks <- &contracts[i]
}
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/metadata/service/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ func (s *TokenService) manager(ctx context.Context) {
continue
}

s.queue.Add(tokens[i].ID)

if ipfs.Is(tokens[i].Link) {
link, err := s.repo.IPFSLinkByURL(tokens[i].Link)
if err == nil {
Expand All @@ -116,7 +118,6 @@ func (s *TokenService) manager(ctx context.Context) {
}
}

s.queue.Add(tokens[i].ID)
s.tasks <- &tokens[i]
}
}
Expand Down

0 comments on commit 6836b36

Please sign in to comment.