mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 16:33:47 +03:00
use wlock when delivering message about new mox version
This commit is contained in:
parent
b7ed035730
commit
d014303617
1 changed files with 8 additions and 2 deletions
|
@ -335,10 +335,16 @@ Only implemented on unix systems, not Windows.
|
|||
return next
|
||||
}
|
||||
m.Size = int64(n)
|
||||
if err := a.DeliverMailbox(log, mox.Conf.Static.Postmaster.Mailbox, &m, f); err != nil {
|
||||
log.Errorx("changelog delivery", err)
|
||||
|
||||
var derr error
|
||||
a.WithWLock(func() {
|
||||
derr = a.DeliverMailbox(log, mox.Conf.Static.Postmaster.Mailbox, &m, f)
|
||||
})
|
||||
if derr != nil {
|
||||
log.Errorx("changelog delivery", derr)
|
||||
return next
|
||||
}
|
||||
|
||||
log.Info("delivered changelog",
|
||||
slog.Any("current", current),
|
||||
slog.Any("lastknown", lastknown),
|
||||
|
|
Loading…
Reference in a new issue