Fix queue event migration (closes #1833)
This commit is contained in:
@@ -62,7 +62,7 @@ impl Queue {
|
||||
locked: AHashMap::with_capacity(128),
|
||||
locked_revision: 0,
|
||||
stats: AHashMap::new(),
|
||||
next_refresh: Instant::now(),
|
||||
next_refresh: Instant::now() + Duration::from_secs(1),
|
||||
is_paused: false,
|
||||
rx,
|
||||
}
|
||||
|
||||
@@ -126,9 +126,14 @@ impl SmtpSpool for Server {
|
||||
|
||||
if due <= now {
|
||||
let queue_id = key.deserialize_be_u64(U64_LEN)?;
|
||||
let queue_name =
|
||||
QueueName::from_bytes(key.get(U64_LEN + U64_LEN..).unwrap_or_default())
|
||||
.unwrap_or_default();
|
||||
let queue_name = key
|
||||
.get(U64_LEN + U64_LEN..)
|
||||
.and_then(QueueName::from_bytes)
|
||||
.ok_or_else(|| {
|
||||
trc::StoreEvent::DataCorruption
|
||||
.caused_by(trc::location!())
|
||||
.ctx(trc::Key::Key, key)
|
||||
})?;
|
||||
|
||||
let add_event = queue
|
||||
.stats
|
||||
|
||||
Reference in New Issue
Block a user