Skip to content

Commit

Permalink
Fix default indexer URL
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Dec 8, 2023
1 parent 4404239 commit 06ead39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion ipni-gc/cmd/ipnigc/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (

var log = logging.Logger("ipni-gc")

const defaultIndexerURL = "http://localhost:3000"

var providerCmd = &cli.Command{
Name: "provider",
Usage: "Run ipni garbage collection for specified providers",
Expand Down Expand Up @@ -94,7 +96,7 @@ func providerAction(cctx *cli.Context) error {

indexerURLs := cctx.StringSlice("indexer")
if len(indexerURLs) == 0 {
indexerURLs = []string{"htto://localhost:3000"}
indexerURLs = []string{defaultIndexerURL}
}

dsDir, err := config.Path("", cfg.Datastore.Dir+"-gc")
Expand Down
8 changes: 6 additions & 2 deletions ipni-gc/reaper/reaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func (s *scythe) reap(ctx context.Context, latestAdCid cid.Cid) error {
} else {
_, ok := removedCtxSet[contextID]
if ok {
log.Debugw("GC removed index content ad", "adCid", adCid)
log.Debugw("GC removing index content ad", "adCid", adCid)
s.stats.IndexAdsRemoved++
// Ad's context ID is removed, so delete all multihashes for ad.
if err = s.deleteEntries(ctx, adCid); err != nil {
Expand Down Expand Up @@ -438,7 +438,11 @@ func (s *scythe) reapPrevRemaining(ctx context.Context, contextID string) error

commit := s.reaper.commit

log.Debugw("Deleting indexes from previously processed ads that have removed contextID", "count", len(ents))
if len(ents) == 0 {
return nil
}

log.Debugw("Deleting indexes from previously processed ads that have removed contextID", "ads", len(ents))
for i := range ents {
key := ents[i].Key
adCid, err := cid.Decode(path.Base(key))
Expand Down

0 comments on commit 06ead39

Please sign in to comment.