refactor: File upload (#5542)

* chore: rename service

* refactor: upload

* chore: save upload meta data

* chore: add sql test

* chore: uploader

* chore: fix upload

* chore: cache file and remove after finish

* chore: retry upload

* chore: pause when netowork unreachable

* chore: add event test

* chore: add test

* chore: clippy

* chore: update client-api commit id

* chore: fix flutter test
This commit is contained in:
Nathan.fooo
2024-06-20 07:44:57 +08:00
committed by GitHub
parent fdaca36b87
commit b64da2c02f
61 changed files with 2687 additions and 643 deletions

View File

@ -88,6 +88,10 @@ impl AuthenticateUser {
PathBuf::from(self.user_paths.user_data_dir(uid)).join("indexes")
}
pub fn get_application_root_dir(&self) -> &str {
self.user_paths.root()
}
pub fn close_db(&self) -> FlowyResult<()> {
let session = self.get_session()?;
info!("Close db for user: {}", session.user_id);

View File

@ -63,6 +63,11 @@ impl UserPaths {
pub(crate) fn user_data_dir(&self, uid: i64) -> String {
format!("{}/{}", self.root, uid)
}
/// The root directory of the application
pub(crate) fn root(&self) -> &str {
&self.root
}
}
impl UserDBPath for UserPaths {