Spam filter performance and accuracy improvements (part 4)
This commit is contained in:
@@ -43,7 +43,12 @@ pub(crate) async fn migrate_addressbook_v013(server: &Server, account_id: u32) -
|
||||
|
||||
for document_id in document_ids.iter() {
|
||||
let Some(archive) = server
|
||||
.archive(account_id, Collection::AddressBook, document_id)
|
||||
.store()
|
||||
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
|
||||
account_id,
|
||||
Collection::AddressBook,
|
||||
document_id,
|
||||
))
|
||||
.await
|
||||
.caused_by(trc::location!())?
|
||||
else {
|
||||
|
||||
@@ -74,7 +74,12 @@ pub(crate) async fn migrate_calendar_v013(server: &Server, account_id: u32) -> t
|
||||
|
||||
for document_id in document_ids.iter() {
|
||||
let Some(archive) = server
|
||||
.archive(account_id, Collection::Calendar, document_id)
|
||||
.store()
|
||||
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
|
||||
account_id,
|
||||
Collection::Calendar,
|
||||
document_id,
|
||||
))
|
||||
.await
|
||||
.caused_by(trc::location!())?
|
||||
else {
|
||||
|
||||
@@ -37,7 +37,12 @@ pub(crate) async fn migrate_contacts_v013(server: &Server, account_id: u32) -> t
|
||||
|
||||
for document_id in document_ids.iter() {
|
||||
let Some(archive) = server
|
||||
.archive(account_id, Collection::ContactCard, document_id)
|
||||
.store()
|
||||
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
|
||||
account_id,
|
||||
Collection::ContactCard,
|
||||
document_id,
|
||||
))
|
||||
.await
|
||||
.caused_by(trc::location!())?
|
||||
else {
|
||||
|
||||
@@ -89,7 +89,12 @@ pub(crate) async fn migrate_calendar_events_v012(server: &Server) -> trc::Result
|
||||
|
||||
for document_id in document_ids.iter() {
|
||||
let Some(archive) = server
|
||||
.archive(account_id, Collection::CalendarEvent, document_id)
|
||||
.store()
|
||||
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
|
||||
account_id,
|
||||
Collection::CalendarEvent,
|
||||
document_id,
|
||||
))
|
||||
.await
|
||||
.caused_by(trc::location!())?
|
||||
else {
|
||||
|
||||
@@ -77,7 +77,12 @@ pub(crate) async fn migrate_calendar_events_v013(
|
||||
|
||||
for document_id in document_ids.iter() {
|
||||
let Some(archive) = server
|
||||
.archive(account_id, Collection::CalendarEvent, document_id)
|
||||
.store()
|
||||
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
|
||||
account_id,
|
||||
Collection::CalendarEvent,
|
||||
document_id,
|
||||
))
|
||||
.await
|
||||
.caused_by(trc::location!())?
|
||||
else {
|
||||
@@ -151,11 +156,12 @@ pub(crate) async fn migrate_calendar_scheduling_v013(
|
||||
|
||||
for document_id in document_ids.iter() {
|
||||
let Some(archive) = server
|
||||
.archive(
|
||||
.store()
|
||||
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
|
||||
account_id,
|
||||
Collection::CalendarEventNotification,
|
||||
document_id,
|
||||
)
|
||||
))
|
||||
.await
|
||||
.caused_by(trc::location!())?
|
||||
else {
|
||||
|
||||
@@ -36,7 +36,12 @@ pub(crate) async fn migrate_push_subscriptions_v013(
|
||||
|
||||
for push_id in &push_ids {
|
||||
match server
|
||||
.archive(account_id, Collection::PushSubscription, push_id)
|
||||
.store()
|
||||
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
|
||||
account_id,
|
||||
Collection::PushSubscription,
|
||||
push_id,
|
||||
))
|
||||
.await
|
||||
{
|
||||
Ok(Some(legacy)) => match legacy.deserialize_untrusted::<PushSubscriptionV2>() {
|
||||
|
||||
@@ -32,7 +32,12 @@ pub(crate) async fn migrate_sieve_v013(server: &Server, account_id: u32) -> trc:
|
||||
|
||||
for script_id in &script_ids {
|
||||
match server
|
||||
.archive(account_id, Collection::SieveScript, script_id)
|
||||
.store()
|
||||
.get_value::<Archive<AlignedBytes>>(ValueKey::archive(
|
||||
account_id,
|
||||
Collection::SieveScript,
|
||||
script_id,
|
||||
))
|
||||
.await
|
||||
{
|
||||
Ok(Some(legacy)) => match legacy.deserialize_untrusted::<SieveScriptV2>() {
|
||||
|
||||
Reference in New Issue
Block a user