mirror of
https://github.com/chatmail/core.git
synced 2026-05-16 21:36:30 +03:00
fix(sqlite): handle non availble stats
This commit is contained in:
@@ -1523,10 +1523,14 @@ pub unsafe fn dc_housekeeping(context: &dc_context_t) {
|
|||||||
|
|
||||||
match std::fs::metadata(std::ffi::CStr::from_ptr(path).to_str().unwrap()) {
|
match std::fs::metadata(std::ffi::CStr::from_ptr(path).to_str().unwrap()) {
|
||||||
Ok(stats) => {
|
Ok(stats) => {
|
||||||
if stats.created().unwrap() > keep_files_newer_than
|
let created =
|
||||||
|| stats.modified().unwrap() > keep_files_newer_than
|
stats.created().is_ok() && stats.created().unwrap() > keep_files_newer_than;
|
||||||
|| stats.accessed().unwrap() > keep_files_newer_than
|
let modified = stats.modified().is_ok()
|
||||||
{
|
&& stats.modified().unwrap() > keep_files_newer_than;
|
||||||
|
let accessed = stats.accessed().is_ok()
|
||||||
|
&& stats.accessed().unwrap() > keep_files_newer_than;
|
||||||
|
|
||||||
|
if created || modified || accessed {
|
||||||
dc_log_info(
|
dc_log_info(
|
||||||
context,
|
context,
|
||||||
0,
|
0,
|
||||||
|
|||||||
Reference in New Issue
Block a user