aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-18 16:03:27 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-18 16:03:27 +0200
commitaeec77ae444789b3bbfd9e9e6ef8c7d33eee48e1 (patch)
treef3ed5dcd3a8d0ffe6840c2c396100f7e098ddfb2 /src/main.rs
parentf3cddcb485978b0508caa7a0efeeed14a11fdd6b (diff)
downloadaerogramme-aeec77ae444789b3bbfd9e9e6ef8c7d33eee48e1.tar.gz
aerogramme-aeec77ae444789b3bbfd9e9e6ef8c7d33eee48e1.zip
Don't try to checkpoint as often
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 461cb11..7b46f01 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -47,7 +47,7 @@ async fn do_stuff() -> Result<()> {
dump(&uid_index);
let mut rand_id = [0u8; 24];
- rand_id[..8].copy_from_slice(&u64::to_be_bytes(thread_rng().gen()));
+ rand_id[..16].copy_from_slice(&u128::to_be_bytes(thread_rng().gen()));
let add_mail_op = uid_index
.state()
.op_mail_add(MailUuid(rand_id), vec!["\\Unseen".into()]);
@@ -55,6 +55,22 @@ async fn do_stuff() -> Result<()> {
dump(&uid_index);
+ if uid_index.state().mails_by_uid.len() > 6 {
+ for i in 0..2 {
+ let (_, uuid) = uid_index
+ .state()
+ .mails_by_uid
+ .iter()
+ .skip(3 + i)
+ .next()
+ .unwrap();
+ let del_mail_op = uid_index.state().op_mail_del(*uuid);
+ uid_index.push(del_mail_op).await?;
+
+ dump(&uid_index);
+ }
+ }
+
Ok(())
}