From 91140da3a7f881e3b0a572e9f780604e536ff387 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Sun, 24 Sep 2023 13:29:32 +0200 Subject: [PATCH] when logging about threading operations, include info about account in verifydata, when warning about missing threading, print the db file. otherwise it isn't clear which account this is about when upgrading account thread storage, pass the logger that has the account name. --- store/threads.go | 4 ++-- verifydata.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/store/threads.go b/store/threads.go index 5c69ce0291..80fb37c7cf 100644 --- a/store/threads.go +++ b/store/threads.go @@ -735,7 +735,7 @@ func upgradeThreads(ctx context.Context, acc *Account, up *Upgrade) error { t0 := time.Now() const batchSize = 10000 - total, err := acc.ResetThreading(ctx, xlog, batchSize, true) + total, err := acc.ResetThreading(ctx, log, batchSize, true) if err != nil { return fmt.Errorf("resetting message threading fields: %v", err) } @@ -757,7 +757,7 @@ func upgradeThreads(ctx context.Context, acc *Account, up *Upgrade) error { t0 := time.Now() const batchSize = 10000 - if err := acc.AssignThreads(ctx, xlog, nil, 1, batchSize, io.Discard); err != nil { + if err := acc.AssignThreads(ctx, log, nil, 1, batchSize, io.Discard); err != nil { return fmt.Errorf("upgrading to threads storage, step 2/2: %w", err) } up.Threads = 2 diff --git a/verifydata.go b/verifydata.go index f04583d1b7..11d74424dc 100644 --- a/verifydata.go +++ b/verifydata.go @@ -245,9 +245,9 @@ possibly making them potentially no longer readable by the previous version. up := store.Upgrade{ID: 1} if err := db.Get(ctxbg, &up); err != nil { - log.Printf("warning: getting upgrade record (continuing, but not checking message threading): %v", err) + log.Printf("warning: %s: getting upgrade record (continuing, but not checking message threading): %v", dbpath, err) } else if up.Threads != 2 { - log.Printf("warning: no message threading in database, skipping checks for threading consistency") + log.Printf("warning: %s: no message threading in database, skipping checks for threading consistency", dbpath) } mailboxes := map[int64]store.Mailbox{}