mirror of
https://github.com/mjl-/mox.git
synced 2025-06-27 21:48:16 +03:00
when reparsing all messages, actually store the new mime structure in the database
This commit is contained in:
parent
75bb1bfa2f
commit
14af5bbb12
@ -983,7 +983,7 @@ type Upgrade struct {
|
||||
MessageParseVersion int // If different than latest, all messages will be reparsed.
|
||||
}
|
||||
|
||||
const MessageParseVersionLatest = 1
|
||||
const MessageParseVersionLatest = 2
|
||||
|
||||
// upgradeInit is the value for new account database, which don't need any upgrading.
|
||||
var upgradeInit = Upgrade{
|
||||
|
@ -103,6 +103,7 @@ func (a *Account) ReparseMessages(ctx context.Context, log mlog.Log) (int, error
|
||||
if r.Err != nil {
|
||||
log.Errorx("marshal parsed form of message", r.Err, slog.Int64("msgid", r.Message.ID))
|
||||
} else {
|
||||
r.Message.ParsedBuf = r.Buf
|
||||
if err := tx.Update(r.Message); err != nil {
|
||||
return fmt.Errorf("update message: %w", err)
|
||||
}
|
||||
@ -120,6 +121,7 @@ func (a *Account) ReparseMessages(ctx context.Context, log mlog.Log) (int, error
|
||||
if r.Err != nil {
|
||||
log.Errorx("marshal parsed form of message", r.Err, slog.Int64("msgid", r.Message.ID))
|
||||
} else {
|
||||
r.Message.ParsedBuf = r.Buf
|
||||
if err := tx.Update(r.Message); err != nil {
|
||||
return fmt.Errorf("update message with id %d: %w", r.Message.ID, err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user