Skip to content

Commit

Permalink
Merge pull request #76 from JackalLabs/marston/bump-page-req
Browse files Browse the repository at this point in the history
changing to page request
  • Loading branch information
dahn510 authored Oct 17, 2024
2 parents fa9987c + 3833a4c commit 4b37029
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/ipfs/go-ds-badger2 v0.1.3
github.com/ipfs/go-ds-flatfs v0.5.1
github.com/ipfs/go-ipld-format v0.6.0
github.com/jackalLabs/canine-chain/v4 v4.1.0
github.com/jackalLabs/canine-chain/v4 v4.1.1
github.com/json-iterator/go v1.1.12
github.com/libp2p/go-libp2p v0.32.2
github.com/multiformats/go-multiaddr v0.12.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,8 @@ github.com/iris-contrib/jade v1.1.4/go.mod h1:EDqR+ur9piDl6DUgs6qRrlfzmlx/D5Uybo
github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g=
github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw=
github.com/iris-contrib/schema v0.0.6/go.mod h1:iYszG0IOsuIsfzjymw1kMzTL8YQcCWlm65f3wX8J5iA=
github.com/jackalLabs/canine-chain/v4 v4.1.0 h1:3PA7UNn2Nu7HHY+LAnpCMQxg32GyRt+F6ntQTLIve/A=
github.com/jackalLabs/canine-chain/v4 v4.1.0/go.mod h1:td0cUHEvmWwqTA+pS8ItQzZxZqFVx/RGqb8MMgOAq+w=
github.com/jackalLabs/canine-chain/v4 v4.1.1 h1:dUkk9kclOLC2Ku3QjNcnya5B7fo13MWPZEVy6qJ8lF8=
github.com/jackalLabs/canine-chain/v4 v4.1.1/go.mod h1:td0cUHEvmWwqTA+pS8ItQzZxZqFVx/RGqb8MMgOAq+w=
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA=
Expand Down
13 changes: 11 additions & 2 deletions recycle/recycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import (
"fmt"
"io"
"io/fs"
"math/rand"
"os"
"path/filepath"
"strings"
"time"

"github.com/cosmos/cosmos-sdk/types/query"

"github.com/JackalLabs/jackal-provider/jprov/archive"
"github.com/jackalLabs/canine-chain/v4/x/storage/types"
"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -174,13 +177,19 @@ func record(file io.Writer, merkle []byte, size int, fid string) error {
func (r *RecycleDepot) collectOpenFiles() ([]types.UnifiedFile, error) {
req := &types.QueryOpenFiles{
ProviderAddress: r.address,
Pagination: nil,
Pagination: &query.PageRequest{
Key: nil,
Offset: 0,
Limit: 300,
CountTotal: true,
Reverse: rand.Int63n(2) == 0,
},
}
resp, err := r.queryClient.OpenFiles(context.Background(), req)
if err != nil {
return nil, err
}
log.Info().Msgf("We found %d files open", len(resp.Files))
log.Info().Msgf("We found %d files open", resp.Pagination.Total)

return resp.Files, nil
}
Expand Down

0 comments on commit 4b37029

Please sign in to comment.