From 3083d5d48a41a5f401435418638b1c4c8375471e Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Thu, 21 Mar 2024 16:51:42 -0400 Subject: [PATCH] Update blox.go --- blox/blox.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/blox/blox.go b/blox/blox.go index 15f6f11..71568b5 100644 --- a/blox/blox.go +++ b/blox/blox.go @@ -692,14 +692,16 @@ func (p *Blox) Start(ctx context.Context) error { } // Call HandleManifestBatchStore method - _, err = p.bl.HandleManifestBatchStore(context.TODO(), p.topicName, storedLinks) - if strings.Contains(err.Error(), "AccountAlreadyStorer") { - // Log the occurrence of the specific error but do not continue - log.Warnw("Attempt to store with an account that is already a storer", "err", err, "p.topicName", p.topicName, "storedLinks", storedLinks) - } else { - // For any other error, log and continue - log.Errorw("Error calling HandleManifestBatchStore", "err", err, "p.topicName", p.topicName, "storedLinks", storedLinks) - continue + if len(storedLinks) > 0 { + _, err = p.bl.HandleManifestBatchStore(context.TODO(), p.topicName, storedLinks) + if strings.Contains(err.Error(), "AccountAlreadyStorer") { + // Log the occurrence of the specific error but do not continue + log.Warnw("Attempt to store with an account that is already a storer", "err", err, "p.topicName", p.topicName, "storedLinks", storedLinks) + } else { + // For any other error, log and continue + log.Errorw("Error calling HandleManifestBatchStore", "err", err, "p.topicName", p.topicName, "storedLinks", storedLinks) + continue + } } }