More logging for "core spams imap events"

TODO: revert
This commit is contained in:
Hocuri
2021-04-10 16:08:41 +02:00
committed by GitHub
parent df277b374d
commit 5394327bf6
4 changed files with 19 additions and 9 deletions

View File

@@ -1505,7 +1505,8 @@ pub unsafe extern "C" fn dc_delete_msgs(
let ctx = &*context;
let msg_ids = convert_and_prune_message_ids(msg_ids, msg_cnt);
block_on(message::delete_msgs(&ctx, &msg_ids))
block_on(message::delete_msgs(&ctx, &msg_ids));
info!(&ctx, "verbose (issue 2335): ffi called dc_delete_msgs()");
}
#[no_mangle]

View File

@@ -262,14 +262,12 @@ pub(crate) async fn dc_receive_imf_inner(
if !created_db_entries.is_empty() {
if needs_delete_job || delete_server_after == Some(0) {
for db_entry in &created_db_entries {
info!(context, "verbose (issue 2335): adding job after receive");
let mut params = Params::new();
params.set(Param::Arg, "comment: verbose (issue 2335) dc_receive_imf()");
job::add(
context,
job::Job::new(
Action::DeleteMsgOnImap,
db_entry.1.to_u32(),
Params::new(),
0,
),
job::Job::new(Action::DeleteMsgOnImap, db_entry.1.to_u32(), params, 0),
)
.await;
}

View File

@@ -635,6 +635,7 @@ impl Job {
// Hidden messages are similar to trashed, but are
// related to some chat. We also delete their
// database records.
info!(context, "verbose (issue 2335): will delete from db");
job_try!(msg.id.delete_from_db(context).await)
} else {
// Remove server UID from the database record.
@@ -645,6 +646,7 @@ impl Job {
// we remove UID to reduce the number of messages
// pointing to the corresponding UID. Once the counter
// reaches zero, we will remove the message.
info!(context, "verbose (issue 2335): will unlink");
job_try!(msg.id.unlink(context).await);
}
Status::Finished(Ok(()))
@@ -1030,6 +1032,7 @@ pub(crate) enum Connection<'a> {
async fn load_imap_deletion_job(context: &Context) -> sql::Result<Option<Job>> {
let res = if let Some(msg_id) = load_imap_deletion_msgid(context).await? {
info!(context, "verbose (issue 2335): loading imap deletion job");
Some(Job::new(
Action::DeleteMsgOnImap,
msg_id.to_u32(),
@@ -1139,7 +1142,7 @@ async fn perform_job_action(
) -> Status {
info!(
context,
"{} begin immediate try {} of job {}", &connection, tries, job
"{} begin immediate try {} of job {:?} - verbose (issue 2335)", &connection, tries, job
);
let try_res = match job.action {
@@ -1398,9 +1401,14 @@ LIMIT 1;
.unwrap_or_default()
.or(Some(job))
} else {
info!(context, "verbose (issue 2335): executing job normally");
Some(job)
}
} else if let Some(job) = load_imap_deletion_job(context).await.unwrap_or_default() {
info!(
context,
"verbose (issue 2335): loaded imap deletion job (no others queued)"
);
Some(job)
} else {
load_housekeeping_job(context).await

View File

@@ -1439,9 +1439,12 @@ pub async fn delete_msgs(context: &Context, msg_ids: &[MsgId]) {
if let Err(err) = msg_id.trash(context).await {
error!(context, "Unable to trash message {}: {}", msg_id, err);
}
info!(context, "verbose delete_msgs()");
let mut params = Params::new();
params.set(Param::Arg, "comment: verbose (issue 2335) delete_msgs()");
job::add(
context,
job::Job::new(Action::DeleteMsgOnImap, msg_id.to_u32(), Params::new(), 0),
job::Job::new(Action::DeleteMsgOnImap, msg_id.to_u32(), params, 0),
)
.await;
}