mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
feat: add attachment search view
This commit is contained in:
@@ -35,7 +35,7 @@ use crate::{
|
||||
cache::imap::mailbox::MailBox,
|
||||
database::{list_all_impl, secondary_find_impl, with_transaction},
|
||||
error::BichonResult,
|
||||
store::tantivy::manager::INDEX_MANAGER,
|
||||
store::tantivy::envelope::ENVELOPE_MANAGER,
|
||||
users::{role::DEFAULT_ACCOUNT_MANAGER_ROLE_ID, UserModel, DEFAULT_ADMIN_USER_ID},
|
||||
},
|
||||
utc_now,
|
||||
@@ -372,7 +372,7 @@ impl AccountV4 {
|
||||
OAuth2AccessToken::try_delete(account.id).await?;
|
||||
UserModel::cleanup_account(account.id).await?;
|
||||
MailBox::clean(account.id).await?;
|
||||
INDEX_MANAGER.delete_account_envelopes(account.id).await?;
|
||||
ENVELOPE_MANAGER.delete_account_envelopes(account.id).await?;
|
||||
Self::delete_account(account.id).await?;
|
||||
info!("Sequential cleanup completed for account: {}", account.id);
|
||||
Ok(())
|
||||
|
||||
@@ -96,10 +96,27 @@ pub struct AccountError {
|
||||
}
|
||||
|
||||
impl DownloadState {
|
||||
pub async fn init(account_id: u64) -> BichonResult<()> {
|
||||
let state = DownloadState {
|
||||
pub fn empty(account_id: u64) -> Self {
|
||||
DownloadState {
|
||||
account_id,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn init(account_id: u64) -> BichonResult<()> {
|
||||
let now = utc_now!();
|
||||
let state = DownloadState {
|
||||
account_id,
|
||||
last_trigger_at: now,
|
||||
active_session: Some(DownloadSession {
|
||||
start_time: now,
|
||||
status: DownloadStatus::Running,
|
||||
trigger: TriggerType::Scheduled,
|
||||
..Default::default()
|
||||
}),
|
||||
history: Default::default(),
|
||||
last_finished_at: Default::default(),
|
||||
global_errors: Default::default(),
|
||||
};
|
||||
upsert_impl(DB_MANAGER.envelope_db(), state).await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user