File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -124,14 +124,16 @@ impl Context {
124
124
/// in case for some providers the quota is always at ~100%
125
125
/// and new space is allocated as needed.
126
126
pub ( crate ) async fn update_recent_quota ( & self , session : & mut ImapSession ) -> Result < ( ) > {
127
+ info ! ( self , "Updating IMAP quota." ) ;
128
+
127
129
let quota = if session. can_check_quota ( ) {
128
130
let folders = get_watched_folders ( self ) . await ?;
129
- get_unique_quota_roots_and_usage ( session, folders) . await
131
+ Some ( get_unique_quota_roots_and_usage ( session, folders) . await ? )
130
132
} else {
131
- Err ( anyhow ! ( stock_str :: not_supported_by_provider ( self ) . await ) )
133
+ None
132
134
} ;
133
135
134
- if let Ok ( quota) = & quota {
136
+ let recent = if let Some ( quota) = & quota {
135
137
match get_highest_usage ( quota) {
136
138
Ok ( ( highest, _, _) ) => {
137
139
if needs_quota_warning (
@@ -153,10 +155,13 @@ impl Context {
153
155
}
154
156
Err ( err) => warn ! ( self , "cannot get highest quota usage: {:#}" , err) ,
155
157
}
156
- }
158
+ Ok ( quota)
159
+ } else {
160
+ Err ( anyhow ! ( stock_str:: not_supported_by_provider( self ) . await ) )
161
+ } ;
157
162
158
163
* self . quota . write ( ) . await = Some ( QuotaInfo {
159
- recent : quota ,
164
+ recent : recent . cloned ( ) ,
160
165
modified : tools:: Time :: now ( ) ,
161
166
} ) ;
162
167
You can’t perform that action at this time.
0 commit comments