From cfda17cab66ea9fd1888688438e7362c7241d879 Mon Sep 17 00:00:00 2001 From: gammazero <11790789+gammazero@users.noreply.github.com> Date: Fri, 13 Dec 2024 07:54:51 -1000 Subject: [PATCH] comments --- mfs/repub.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mfs/repub.go b/mfs/repub.go index 25228c47a..0ad0d33a2 100644 --- a/mfs/repub.go +++ b/mfs/repub.go @@ -111,6 +111,11 @@ func (rp *Republisher) Update(c cid.Cid) { // duration. The `quick` timer allows publishing sooner if there are no more // updates available. // +// In other words, the quick timeout means there are no more values to put into +// the "batch", so do update. The long timeout means there are that the "batch" +// is full, so do update, even though there are still values (no quick timeout +// yet) arriving. +// // If a publish fails, retry repeatedly every `longer` timeout. func (rp *Republisher) run(ctx context.Context, timeoutShort, timeoutLong time.Duration, lastPublished cid.Cid) { defer close(rp.stopped) @@ -141,7 +146,7 @@ func (rp *Republisher) run(ctx context.Context, timeoutShort, timeoutLong time.D break } - // If mot already waiting to publish something, reset the long + // If not already waiting to publish something, reset the long // timeout. if !toPublish.Defined() { longer.Reset(timeoutLong)