Skip to content

Commit

Permalink
Update blox.go
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha committed Mar 21, 2024
1 parent 9ff6fb9 commit ccc1d08
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions blox/blox.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ func (p *Blox) GetLastCheckedTime() (time.Time, error) {

// This method fetches the pinned items in ipfs-cluster since the lastChecked time
func (p *Blox) ListModifiedStoredLinks(ctx context.Context, lastChecked time.Time) ([]datamodel.Link, error) {
log.Debugw("ListModifiedStoredLinks", "lastChecked", lastChecked)
var storedLinks []datamodel.Link
if p.ipfsClusterApi == nil {
log.Errorw("ipfs cluster API is nil", "p.ipfsClusterApi", p.ipfsClusterApi)
Expand All @@ -330,6 +331,7 @@ func (p *Blox) ListModifiedStoredLinks(ctx context.Context, lastChecked time.Tim

// Filter pins based on status and creation time
for pinInfo := range out {
log.Debugw("ListModifiedStoredLinks loop", "pinInfo", pinInfo)
if pinInfo.Match(api.TrackerStatusPinned) && pinInfo.Created.After(lastChecked) {
storedLinks = append(storedLinks, cidlink.Link{Cid: pinInfo.Cid.Cid})
}
Expand Down

0 comments on commit ccc1d08

Please sign in to comment.