]> git.giacomolli.uk - onechat/blobdiff - probe.go
Retry the first WhatsApp connection
[onechat] / probe.go
index 0b809e89f84d86ef7150b3f9dcfb18b50b6d77d4..5b233ed4455cbbec82739d6e456f0da7c4eba1d3 100644 (file)
--- a/probe.go
+++ b/probe.go
@@ -8,6 +8,7 @@ import (
        "errors"
        "fmt"
        "io"
+       "log"
        "maps"
        "os"
        "path/filepath"
@@ -105,7 +106,9 @@ func probe(ctx context.Context, args []string, out io.Writer) (err error) {
                slots: make(chan struct{}, builds),
        }
 
-       memory, err := openMemory(ctx, root, time.Now, summarizer)
+       // The report of the probe counts the failed calls, so the lines of the
+       // failed builds are not needed.
+       memory, err := openMemory(ctx, root, time.Now, summarizer, log.New(io.Discard, "", 0))
        if err != nil {
                return err
        }
@@ -435,7 +438,7 @@ func probeStop(records []ModelUsageRecord) string {
 
 // probeBuiltByModel tells if the node key needed a model call: a leaf whose
 // source is over nodeBytes, or a merge whose children do not fit in one node.
-func probeBuiltByModel(memory *Memory, key nodeKey) (bool, error) {
+func probeBuiltByModel(memory *Memory, key NodeKey) (bool, error) {
        if key.level == 0 {
                message, err := memory.log.Message(key.index)
                if err != nil {