Skip to content

Commit

Permalink
added ipfs gc call before getting stored cids
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha committed Mar 25, 2024
1 parent 3a8114d commit 009e502
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion blox/blox.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ func (p *Blox) Start(ctx context.Context) error {
log.Debug("Called wg.Done in blox.start")
defer p.wg.Done()
defer log.Debug("Start blox blox.start go routine is ending")
ticker := time.NewTicker(10 * time.Minute)
ticker := time.NewTicker(15 * time.Minute)
defer ticker.Stop()
for {
select {
Expand All @@ -716,6 +716,9 @@ func (p *Blox) Start(ctx context.Context) error {
}
p.topicName = p.getPoolName()
if p.topicName != "0" {
shortCtx, shortCtxCancel := context.WithDeadline(p.ctx, time.Now().Add(60*time.Second))
defer shortCtxCancel()
p.rpc.Request("repo/gc").Send(shortCtx)
storedLinks, err := p.ListModifiedStoredBlocks(lastCheckedTime)
if err != nil {
log.Errorf("Error listing stored blocks: %v", err)
Expand Down

0 comments on commit 009e502

Please sign in to comment.