From b022c34a2316d60991bab2e8100aef16314637ee Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 31 Mar 2021 07:06:58 -0400 Subject: [PATCH] try to record buntdb errors from persisting lastSeen See #1603 --- irc/accounts.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/irc/accounts.go b/irc/accounts.go index 413e1780..cfa12977 100644 --- a/irc/accounts.go +++ b/irc/accounts.go @@ -614,7 +614,7 @@ func (am *AccountManager) saveLastSeen(account string, lastSeen map[string]time. text, _ := json.Marshal(lastSeen) val = string(text) } - am.server.store.Update(func(tx *buntdb.Tx) error { + err := am.server.store.Update(func(tx *buntdb.Tx) error { if val != "" { tx.Set(key, val, nil) } else { @@ -622,6 +622,9 @@ func (am *AccountManager) saveLastSeen(account string, lastSeen map[string]time. } return nil }) + if err != nil { + am.server.logger.Error("internal", "error persisting lastSeen", account, err.Error()) + } } func (am *AccountManager) loadLastSeen(account string) (lastSeen map[string]time.Time) {