add device message if quota is exceeding (#2621)

* resultify update_recent_quota()

* add a device-message if quota exceeds QUOTA_WARN_THRESHOLD_PERCENTAGE

* check if a quota warning should be added during housekeeping, this is at least once a day

* dc_get_config("quota_exceeding") is useful for bots

* make clippy happy

* reword QuotaExceedingMsgBody message

* avoid lots of warnings if quota jitters around the warning threshold

* allow clippy::assertions_on_constants

these constants depend on each other, it makes sense to check that they are not changed in an incompatible way
This commit is contained in:
bjoern
2021-08-26 15:31:25 +02:00
committed by GitHub
parent 3aa2b57ac1
commit 71e0493c4a
7 changed files with 136 additions and 5 deletions

View File

@@ -1152,7 +1152,10 @@ async fn perform_job_action(
sql::housekeeping(context).await.ok_or_log(context);
Status::Finished(Ok(()))
}
Action::UpdateRecentQuota => context.update_recent_quota(connection.inbox()).await,
Action::UpdateRecentQuota => match context.update_recent_quota(connection.inbox()).await {
Ok(status) => status,
Err(err) => Status::Finished(Err(err)),
},
};
info!(context, "Finished immediate try {} of job {}", tries, job);