mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
fix: Update quota if it's stale, not fresh (#5683)
This commit is contained in:
@@ -547,7 +547,7 @@ impl Context {
|
|||||||
.as_ref()
|
.as_ref()
|
||||||
.filter(|quota| {
|
.filter(|quota| {
|
||||||
time_elapsed("a.modified)
|
time_elapsed("a.modified)
|
||||||
> Duration::from_secs(DC_BACKGROUND_FETCH_QUOTA_CHECK_RATELIMIT)
|
< Duration::from_secs(DC_BACKGROUND_FETCH_QUOTA_CHECK_RATELIMIT)
|
||||||
})
|
})
|
||||||
.is_none()
|
.is_none()
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ async fn inbox_fetch_idle(ctx: &Context, imap: &mut Imap, mut session: Session)
|
|||||||
let quota = ctx.quota.read().await;
|
let quota = ctx.quota.read().await;
|
||||||
quota
|
quota
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.filter(|quota| time_elapsed("a.modified) > Duration::from_secs(60))
|
.filter(|quota| time_elapsed("a.modified) < Duration::from_secs(60))
|
||||||
.is_none()
|
.is_none()
|
||||||
};
|
};
|
||||||
if quota_needs_update {
|
if quota_needs_update {
|
||||||
|
|||||||
Reference in New Issue
Block a user