mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 23:31:24 +01:00
ignore files that were probably never created
File data is inserted into the database before being created on disk, which means that it's possible for data to exist in the database that doesn't exist on disk. In this case, the media deletion functions should simply ignore this error.
This commit is contained in:
parent
ca6bc74074
commit
d848e787d3
1 changed files with 4 additions and 0 deletions
|
|
@ -135,6 +135,10 @@ impl Service {
|
|||
Ok(()) => (),
|
||||
// The file in the fs may already have been deleted by hand
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => (),
|
||||
// The file may have never existed in the fs because the name was
|
||||
// too long
|
||||
#[cfg(unix)]
|
||||
Err(e) if e.raw_os_error() == Some(nix::libc::ENAMETOOLONG) => (),
|
||||
other_error => other_error?,
|
||||
}
|
||||
self.db.delete_file_metadata(key)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue