add rate limit for quota check in background fetch (12h for now)

This commit is contained in:
Simon Laux
2024-01-04 06:53:46 +01:00
committed by bjoern
parent 5cbc87369e
commit 946eea4c9e
2 changed files with 17 additions and 4 deletions

View File

@@ -214,6 +214,9 @@ pub(crate) const DC_FOLDERS_CONFIGURED_VERSION: i32 = 4;
// `max_smtp_rcpt_to` in the provider db.
pub(crate) const DEFAULT_MAX_SMTP_RCPT_TO: usize = 50;
/// How far the last quota check needs to be in the past to be checked by the background function (in seconds).
pub(crate) const DC_BACKGROUND_FETCH_QUOTA_CHECK_RATELIMIT: i64 = 12 * 60 * 60; // 12 hours
#[cfg(test)]
mod tests {
use num_traits::FromPrimitive;