From c6bc125c5689a783efe28686ef3b7bdc47133ea0 Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Thu, 28 Mar 2024 11:07:07 -0400 Subject: [PATCH] added ipfs-cluster recover on blox start --- blox/blox.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/blox/blox.go b/blox/blox.go index 5149e01..0d56624 100644 --- a/blox/blox.go +++ b/blox/blox.go @@ -642,6 +642,15 @@ func (p *Blox) Start(ctx context.Context) error { if err := p.bl.FetchUsersAndPopulateSets(ctx, p.topicName, true, 15*time.Second); err != nil { log.Errorw("FetchUsersAndPopulateSets failed", "err", err) } + recoverOut := make(chan api.GlobalPinInfo) + go func() { + err := p.ipfsClusterApi.RecoverAll(ctx, true, recoverOut) + if err != nil { + // Handle error + log.Errorw("RecoverAll error", "err", err.Error()) + } + close(recoverOut) // Close the channel when RecoverAll is done + }() // Create an HTTP server instance if p.DefaultIPFShttpServer == "fula" {